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!

InnerText or innerHTML

Status
Not open for further replies.

yahve

Programmer
Nov 14, 2000
159
CA
Hi,

I have a script which refreshes the content of a div like so:

document.getElementById(divRightTop).innerHTML = "whatever";

It works in IE, but I can't get it to work in NS. What would I need to change? Is it better to use innerText or innerHTML?

Thanks and may 2001 bring you love, health and prosperity.
Vieux motard que jamais...
 
if you are only inserting text, just use innerText, for performance reasons. NS4.x and lower do not support an innerHTML or innerText property, you have to access it something like this:

document.layers.layername.document.write('stuff')

to write new content to it, and that only works on absolutely positioned elements... jared@aauser.com
 
You can also set the document.layers.layername.src property to the location of the stuff you want to go in there.
Sincerely,

Tom Anderson
CEO, Order amid Chaos, Inc.
 
Thank you both for your input.

Happy new year.
Vieux motard que jamais...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top