The Status Line

Web browsers typically display a status line at the bottom of every window (except for those explicitly created without one), where the browser can display messages to the user. When the user moves the mouse over a hypertext link, for example, the browser usually displays the URL to which the link points. And when the user moves the mouse over a browser control button, the browser may display a simple context help message that explains the purpose of the button. You can also make use of this status line in your own programs. Its contents are controlled by two properties of the Window object: status and defaultStatus.

Although web browsers usually display the URL of a hypertext link when the user passes the mouse pointer over the link, you may have encountered some links that don’t behave this way -- links that display some text other than the link’s URL. This effect is achieved with the status property of the Window object and the onmouseover event handler of hypertext links:

<!-- Here's how you set the status line in a hyperlink. -- Note that the event handler *must* return true for this to work. --> Lost? Dazed and confused? Visit the <a href="sitemap.html" onmouseover="status='Go to Site Map'; return true;"> Site Map </a> <!-- You can do the same thing for client-side image maps --> <img src="images/imgmap1.gif" usemap="#map1"> <map name="map1"> <area coords="0,0,50,20" href="info.html" onmouseover="status='Visit our Information Center'; return true;"> <area ...

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.