HTML and CSS Reference
In-Depth Information
Form Event Handlers
Form event handlers can be used to make forms interactive (see Table 3-13 ).
Table 3-13. Form Event Handlers
Attribute
Runs the Script...
onblur
When an element lost focus
oncancel
When cancelling a file upload
onchange
On element change
onfocus
When an element received focus
oninput
On user input
oninvalid
On invalid user input
onreset
When the user clicks on the Reset button of a form
onselect
After some text has been selected in an element
onshow
When a menu element is shown as a context menu
onsubmit
On form submit
ontoggle
When the user opens or closes the details element
Window Event Handlers
The window event handlers supported by all Window objects are summarized in Table 3-14 .
Table 3-14. Window Event Handlers
Attribute
Runs the Script ...
onafterprint
After the document is printed
onbeforeprint
Before the document is printed
onbeforeonload
Before the document is loaded
onhashchange
When the anchor of a URL is changed
onmessage
When the message is activated
onoffline
When the document goes offline
ononline
When the document comes online
onpagehide
When the window is hidden
onpageshow
When the window becomes visible
onpopstate
When the window history changes
( continued )
 
Search WWH ::




Custom Search