(X)HTML – CSS Gebeurtenissen
An intrinsic event determines when an associated script will run. However, not every intrinsic event works with every (X)HTML element. This table illustrates which events and tags work together. For more information about intrinsic events and scripting, please consult pages 314-5 and Appendix C in my book HTML, XHTML, and CSS, 6th Edition: Visual QuickStart Guide, by Elizabeth Castro, published by Peachpit Press.
| Event Name and Tags It Works With | When It Works |
|---|---|
| onblur
works with |
when the visitor leaves an element that was previously in focus (see onfocus below) |
| onchange
works with |
when the visitor modifies the value or contents of the element |
|
onclick works with all elements except |
when the visitor clicks on the specified area |
| ondblclick
works with same elements as onclick |
when the visitor double clicks the specified area |
|
onfocus works with |
when the visitor selects, clicks, or tabs to the specified element |
| onkeydown
works with |
when the visitor types something in the specified element |
| onkeypress
works with |
when the visitor types something in the specified element |
| onkeyup
works with |
when the visitor lets go of the key after typing in the specified element |
| onload
works with |
when the page is loaded in the browser |
| onmousedown
works with same elements as onclick |
when the visitor presses the mouse button down over the element |
| onmousemove
works with same elements as onclick |
when the visitor moves the mouse over the specified element after having pointed at it |
| onmouseout
works with same elements as onclick |
when the visitor moves the mouse away from the specified element after having been over it |
| onmouseover
works with same elements as onclick |
when the visitor points the mouse at the element |
| onmouseup
works with same elements as onclick |
when the visitor lets the mouse button go after having clicked on the element |
| onreset
works with |
when the visitor clicks the form’s reset button |
| onselect
works with |
when the visitor selects one or more characters or words in the element |
| onsubmit
works with |
when the visitor clicks the form’s submit button |
| onunload
works with |
the browser loads a different page after the specified page had |
