faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

34 of 54 people (63%) answered Yes
Recently 8 of 10 people (80%) answered Yes

Entry

In IE5, I can put dynamic content using the object.innerText. How should I do this in netscape because NS doesn't have this property for document?

Apr 4th, 2008 20:53
ha mo, Tony Crosby, HUI HUI,


if (document.all){
// IE CODE
objCount = document.getElementById('NAME');
objCount.innerText="THE TEXT";
}else{
// MOZILLA & NETSCAPE CODE
document.getElementById("NAME").childNodes[0].nodeValue="THE TEXT";
}
}
 Simply change the NAME field to target different <div> layers and on
more thing, netscape won't change the value of the div layer if it is empty.
<div id="NAME"></div>
 won't work.
 Oddly enough you have to at least through a space in there.
<div id="NAME"> </div> // Like that
 I just went through all this today.
 Tony
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com