Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q581 How can I highlight normal text using onMouseover?

You are here: irt.org | FAQ | DHTML | Q581 [ previous next ]

The following works in Netscape Navigator 4 and 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>

Joe Phillips writes:

Causes an instant application crash in Internet Explorer 5 for the Mac.

Feedback on 'Q581 How can I highlight normal text using onMouseover?'

©2018 Martin Webb