HTML and CSS Reference
In-Depth Information The event attributes
A number of event handlers are built into modern browsers. These
handlers watch for certain conditions and user actions, such as a click of
the mouse or when an image finishes loading into the browser window.
With client-side JavaScript, you may include selected event handlers as
attributes of certain tags and execute one or more JavaScript commands
and functions when the event occurs.
With the anchor ( <a> ) tag, you may associate JavaScript code with a
number of mouse- and keyboard-related events. The value of the event
handler isenclosed in quotation marksone or a sequence of semicolon-
separated JavaScript expressions, methods, and function references
that the browser executes when the event occurs. [ JavaScript Event
Handlers, 12.3.3 ]
A popular, albeit simple, use of the onMouseOver event with a hyperlink
is to print an expanded description of the tag's destination in the
JavaScript-aware browser's status box ( Figure 6-3 ). Normally, the
browser displays the frequently cryptic destination URL there whenever
the user passes the mouse pointer over an <a> tag's contents:
<a href=""
onMouseOver="status='A yummy recipe for kumquat soup.'; return true;">
<img src="pics/bowl.gif" border=0>
Search WWH ::

Custom Search