Click to See Complete Forum and Search --> : .innerHTML in netscape


BestZest
10-13-2003, 03:18 PM
I have the following code, in which I have a <span> block with the ID of "view". In IE when the function is called the text in toWrite appears in the span, but in netscape it doesn't. Does any one know how I could get this to work in Netscape?

toWrite = "This is the text to appear in the span"
document.getElementById("view").innerHTML=toWrite

Thanks,
BestZest

pyro
10-13-2003, 03:25 PM
Which version does that not work for you in? It worked for me in Netscape 6 and 7 (but not in Netscape 4.7, as that does not support getElementById).

Khalid Ali
10-13-2003, 03:25 PM
Nothig seems to be wrong with the code .
Make sure that the id is same as you are using in getElementById().

And most imortatantly it should work with NS6+ browser of u are using an older NS browser it will not work

BestZest
10-13-2003, 03:31 PM
I'm using NS 7, and this code syntax is correct, so it must be another part of the code that is not supported by NS, thanks for your help anyways guys! :)