Deconstructing onMouseOver Script

<A HREF="URL" onMouseOver="window.status='Phrase'; return true">Link</A>

First of all, it's important to notice the capitalization pattern of the onMouseOver Event Handler. This Handler creates an event in conjunction with the hypertext link, which doesn't make sense, because it's INSIDE the hypertext link.

The format for the hypertext link remains according to HTML standards, using the same commands and the same double quotations. The Event Handler is tacked right after the URL address, as shown in the code above, but it doesn't have to be. You can stick it in after the A part, like this:

<A onMouseOver="window.status='Phrase'; return true" HREF="URL">Link</A>

The event is called for by writing onMouseOver and then telling the browser to do something when the mouse actually passes over the link. In this case, "window.status='Phrase'. The pattern should look familiar: two items separated by a period. The window is an object; it exists. The status is a property of window. It is that section at the bottom of the window, where status messages go. The "window.status statement tells the browser to display the following text in the status bar.

Which is Properties? Which is Methods?

Methods are usually in the form of a verb, such as write or go.
A property is a noun that exists as a smaller part of that item in front of the dot.

In the script, "window.status is followed by an equal sign (=) telling the browser that what follows is supposed to happen after the event. In this case, what follows is 'Phrase', in single quotation marks. This text should appear in the status bar after the mouse rolls over the link.

Back Table of Contents Next