Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.innerHTML problem...

Status
Not open for further replies.

MattoThePotatto

Programmer
Jun 25, 2008
11
NZ
Hey. I've tried the following code.. No success...
...
<script src="script.js">
</script>
...
<span id="one">&nbsp;</span>
...


And the script..
document.getElementById('one').innerHTML="what ever here";
...
rest of script here (Working fine)

Any solutions?
Thanks, ^^
 
...
<script src="script.js">
</script>
...
<span onload="spanText()" id="one">&nbsp;</span>
...


And the script..
function spanText() {
document.getElementById('one').innerHTML="what ever here";
}
...

I tried the above.. No success :S
 
><span onload="spanText()" id="one">&nbsp;</span>
No such thing of onload event of span tag.
[tt]
<body onload="spanText()">
<!-- etc etc -->
<span id="one">&nbsp;</span>[/tt]
 
Thanks ^^ Worked, :) Can I call more than one function at a time with onload?
<body onload="firstfunction()" onload="secondfunction()">
 
><body onload="firstfunction()" onload="secondfunction()">
[tt]<body onload="firstfunction();secondfunction()"> [/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top