The onMouseOver Event

Next is events, which are things that happen. They can add life and interest to my website and make viewers say "ooooh" without me having to create large JavaScripts. Event Handlers are the commands done after events happen. But here's the can of worms: although events are JavaScripts, they are unlike what I've learned so far. Events are "built-in" to HTML code, rather than stand alone. They do not require the <SCRIPT> and </SCRIPT> commands because they are not actually scripts. They are simply small interfaces allowing interaction between webpage and viewer.

The most popular event is the onMouseOver. In the old days, the specified text ('Go to the Goodies Home Page') appeared in the status bar, at the exact moment when the cursor hovered over the hypertext link. Unfortunately, this made it possible to make links look like a "good" website, when it was, in fact, a "bad" website. So, for security reasons, this behaviour no longer works in the default configuration of most modern browsers today. The actual URL of the link is always displayed in the status bar with the mouseOver, so users can see where they are actually going to go when they click that mouse button. Only in the Internet Explorer browser, will the specified text overwrite the URL in the status bar when the cursor is moved away from the link, as long as the user is on the page. Other browsers do not do any overwriting at all!

HTML file: Displayed by browser:
<body>

<A HREF="http://www.htmlgoodies.com" target="_blank"
onMouseOver="window.status='Go to the Goodies Home Page';
    return true">Click Here</A>

</body>
Click Here

The status bar shows the specified window.status phrase, only after the user mouses over the link, in Internet Explorer. (This does not happen in Firefox nor Chrome.)

BackTable of ContentsNext