/    Sign up×
Community /Pin to ProfileBookmark

No Firebub Error but Script not Working

Hi all,
I’m very new to javascript and I’m practicing the creation of dynamic contents by using getElementByID and innerHTML and ran into a problem. I used Firebug to check for errors and didn’t see any but my script is not working.
When the page loads, my script is supposed to create new contents for a div with the id of Client_Info if it does not contain any inside it.

The following are my the contents of my external javascript file called CreateTag.js and my HTML Markup:
function Delete_Div()
{

var myElement= document.getElementbyID(Client_Info);

//Onload Check if the contents of Client_Info is equal to the value in the parenthesis
if(myElement.innerHTML!=””)
{
//Rewrite the contents with the following values
myElement.innerHTML==<div id=’Display’ style=’position:relative;width:100%;’>
<img alt=’Faces’ src=’images/Clients/YourFullAd.jpg’ id=’Gallery’ style=’position:relative;margin-left:45%;top:10px;’ >
<div id=’ScopeCap’ style=’position: relative; margin-left:45%; top:65px;’> </div>
</div>”
}

}

<body onLoad = “Delete_Div()” onUnload = “Delete_Div()”>
<div =”Client_Info”>
<div id=’Display’><img alt=”Pets src=’images/Clients/myDod.jpg’ id=’Gallery’ ></div>
</div>
</body>

Please take a look and see where I went wrong, thanks in advance.

to post a comment
JavaScript

1 Comments(s)

×

Success!

Help @Developer1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...