HTML and CSS Reference
In-Depth Information
Event Attribute Event Description
onblur
Occurs when an element loses focus, meaning that the user has moved focus to
another element, typically either by clicking the mouse or tabbing.
onchange
Signals that the form control has lost user focus and its value has been modified
during its last access.
onclick
Indicates that the element has been clicked.
ondblclick
Indicates that the element has been double-clicked.
onfocus
Indicates that an element has received focus; namely, it has been selected for
manipulation or data entry.
onkeydown
Indicates that a key is being pressed down with focus on the element.
onkeypress
Describes the event of a key being pressed and released with focus on the
element.
onkeyup
Indicates that a key is being released with focus on the element.
onload
Indicates the event of a window or frame set finishing the loading of a document.
onmousedown
Indicates the press of a mouse button with focus on the element.
onmousemove
Indicates that the mouse has moved while over the element.
onmouseout
Indicates that the mouse has moved away from an element.
onmouseover
Indicates that the mouse has moved over an element.
onmouseup
Indicates the release of a mouse button with focus on the element.
Indicates that the form is being reset, possibly by the click of a reset button.
onreset
onselect
Indicates the selection of text by the user, typically by highlighting the desired text.
onsubmit
Indicates a form submission, generally by clicking a submit button.
Indicates that the browser is leaving the current document and unloading it from
the window or frame.
onunload
T
ABLE
3-4 W3C-Defined Core Events
additions. Some of the newer features are already implement in Internet Explorer or other
browsers but many are not. Table 3-5 summarizes all the events you may see on the various
previewed HTML5 elements in this chapter. As all things concerning HTML5, the
specification (www.w3.org/TR/html5) is the best place to go for the latest information.
Internet Explorer's Extended Event Attributes
Most browsers support events other than those defined in the W3C specifications. Microsoft,
in particular, has introduced a variety of events to capture more-complex mouse actions such
as dragging, element events such as the bouncing of
marquee
text, data-binding events
signaling the loading of data into an object, and fine-grained event control to catch events