A.2. Event Attributes
The following section lists those attributes relevant to providing script hooks for responding to events such as page loading and mouse movement.
A.2.1. Standard Events
The standard event attributes that are supported by most elements:
Attribute | Triggered By |
---|---|
onclick | Pointer button was clicked. |
ondblclick | Pointer button was double clicked. |
onmousedown | Pointer button was pressed down. |
onmouseup | Pointer button was released. |
onmouseover | Pointer was moved into. |
onmousemove | Pointer was moved within. |
onmouseout | Pointer was moved away. |
onkeypress | Key was pressed and released. |
onkeydown | Key was pressed. |
onkeyup | Key was released. |
A.2.2. Other Events
Less-common event attributes:
Attribute | Triggered By |
---|---|
onload | Document has been loaded. |
onunload | Document has been removed. |
onblur | Element lost focus. |
onfocus | Element gained focus. |
onreset | Form was reset. |
onsubmit | Form was submitted. |
onchange | Form element value changed. |
onselect | Text in a form field has been selected. |
Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP 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.