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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE's 'innerHTML' in Netscape

Status
Not open for further replies.

safra

Technical User
Jan 24, 2001
319
NL
Hi,

I use 'innerHTML' to change contents within <div> tags which works fine for IE browsers but not for Netscape!

Is there a workaround for this for Nescape or better one solution that works for both?

regards,

Ron
 
Thanks rycamor,

I had a look there. I know that site, they are good! I tested their solution but it doesn't work for the latest netscape version. I did a little test and it seems that &quot;layer&quot; is not supported by NS6.

Anybody knows till what version &quot;layer is supported and what the equivalent is for NS6.

Ron

 
NS6 behaves as a (mostly) W3C compliant browser. There is no equivalent to a layers collection, as every element on the page is exposed to script through the DOM. To access a div with an id of 'benluc' in NS6 (and IE5+!!):

mydiv = document.getElementById(&quot;benluc&quot;)

now you can use (for IE5+/NS6):

mydiv.style.backgroundColor=&quot;black&quot;

or:

mydiv.innerHTML = &quot;Crossbrowser code without <b>trying</b>!!&quot;

now the sad part of the story... NS4 is holding back the web. Do everything in your power not to support it. :)

jared@eae.net -
 
thanks for that jaredn, it now works for IE4+ and IE5+

The next step is to rewrite all of this to target a div in another frame which will probably give me more headaches!

Thanks a lot!

Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top