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

Q581 How can I highlight normal text using onMouseover?

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

Q581 How can I highlight normal text using onMouseover?

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?'


Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


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