HTML and CSS Reference
In-Depth Information
Keyboard Event Handlers
HTML supports three keyboard events: the user pressed down a key, the user is holding down a key, and the user
released a key (see Table 3-10 ).
Table 3-10. Keyboard Event Handlers
Attribute
Runs the Script When...
onkeydown
A key is pressed
onkeypress
A key is pressed and released
onkeyup
A key is released
Mouse Event Handlers
On Graphical User Interfaces (GUIs), user actions are often triggered by the mouse. The mouse event attributes
described in Table 3-11 apply to all HTML5 elements.
Table 3-11. Mouse Event Handlers
Attribute
Runs the Script...
onclick
On a single click
ondblclick
On a double-click
onmousedown
When the mouse button is pressed
onmouseenter
When the mouse pointer reaches an area
onmouseleave
When the mouse pointer leaves an area
onmousemove
When the mouse pointer moves
onmouseout
When the mouse pointer moves out of an element
onmouseover
When the mouse pointer moves over an element
onmouseup
When the mouse button is released
onmousewheel
When the mouse wheel is being rotated
onscroll
When the scrollbar of an element is being scrolled
 
 
Search WWH ::




Custom Search