HTML and CSS Reference
In-Depth Information
Figure 13.1 Before clicking the button (left); after clicking and waiting five seconds
(right).
A list of JavaScript event handlers and their uses is given in Table 13.1.
Table 13.1 JavaScript Event Handlers and What They Do
Event Handler
What It Affects
When It Happens
onAbort
Images
When image loading has been interrupted.
onBlur
Windows, frames,
all form objects
When focus moves out of this object except
hidden ; e.g., when the cursor leaves a textbox.
onChange
Input, select, and text areas
When a user changes the value of an element
and it loses the input focus. Used for form
validation.
onClick
Links, buttons, form objects,
image map areas
When a user clicks on an object. Return false
to cancel default action.
onDblClick
Links, buttons, form objects
When a user double-clicks on an object.
onDragDrop
Windows
When a user drops an object, such as a file,
onto the browser window.
onError
Script
When an error in the script occurs; e.g., a
syntax error.
onFocus
Windows, frames,
all form objects
When a mouse is clicked or moved in a
window or frame and it gets focus; except
hidden .
onKeyDown
Documents, images, links, forms
When a key is pressed.
onKeyPress
Documents, images, links, forms
When a key is pressed and released.
onKeyUp
Documents, images, links, forms
When a key is released.
onLoad
Body, framesets, images
After the document or image is loaded.
onMouseOut
Links (and images within links)
When the mouse moves away from a link.
 
Search WWH ::




Custom Search