Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

Q779 Does navigator have a comparable innerHTML property?

irt.org | Knowledge Base | DHTML | Q779 [ previous next ]

Q779 Does navigator have a comparable innerHTML property?

Netscape Navigator 4.0 does not have a comparable innerHTML property. This does not mean that Netscape Navigator cannot write dynamic content like Microsoft Internet Explorer, as you can open, write to, and then close a layer. The difficulty is that you have to write a solution that works perfectly on both Netscape Navigator and Microsoft Internet Explorer.

The following is a simple example that works in both Netscape Navigator 4 and Microsoft Internet Explorer 4:

<P>
<script language="JavaScript"><!--
function changeContent(what,text) {
    if (document.all)
        what.innerHTML = text;
    else if (document.layers) {
        what.document.open();
        what.document.write(text);
        what.document.close();
    }
}
//--></script>

<p>
<div onMouseOver="changeContent(this,'<font color=red>Ha! You moved the mouse over the text</font>')"
  onMouseOut="changeContent(this,'Move the mouse pointer over this text')">
<layer onMouseOver="changeContent(this,'<font color=red>Ha! You moved the mouse over the text</font>')"
  onMouseOut="changeContent(this,'Move the mouse pointer over this text')">
Move the mouse pointer over this text
</layer>
</div>
</p>

Also take a look at the article What is So Dynamic About Dynamic HTML?

Feedback on 'Q779 Does navigator have a comparable innerHTML property?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.