The onMouseOut After-Effect

I already know that the onMouseOver command makes things happen when the mouse passes over something on the HTML page. The onMouseOut command acts after the mouse leaves the link.

Unfortunately, in the example below, the first event does NOT write to the status bar... instead, it puts the URL of the link there. However, the second event DOES write to the status bar if using IE, but the other browsers do not show anything except the URL in the status bar. It's a security thing nowadays.

Even though it might not work (it DOES work if running from a hard drive with IE), I'll still post this code, which uses the onMouseOut Event Handler:

HTML file: Displayed by browser:
<body>

<p>Watch your status bar:</p>
<A HREF="thanxalot.html"
onMouseOver="window.status='Hey! Get off of me!'; return true"
onMouseOut="window.status='Much better - Thanks'; return true">
Place your mouse on and off of this link</A>

</body>

Watch your status bar:

Place your mouse on and off of this link

Notice the semicolon terminating each event, as well as the return true. The two events cannot be happening at the same time, like the simultaneous onMouseOver and bgColor effect in Lesson 5.

Surprisingly, many websites are still posting similiar scripts and assuming that these events still work, including the Javascript Goodies answer page!

BackTable of ContentsNext