HTML5 Events Handler List
-
Following all event handlers Window Event Attributes, Form Events, Keyboard Events, Mouse Events, Media Events are support in all HTML5 Tags.
-
Global event attributes that's added to a HTML elements to define event and fired when occur specific action.
Window Event Attributes
Window Events triggered for a window object and apply in <body> tag
Attributes | Value | Description | In HTML5? |
---|---|---|---|
onafterprint | js_script | Script is run after the document is printed | NEW |
onbeforeprint | js_script | Script is run before the document is printed | NEW |
onbeforeunload | js_script | Script is run before the document is unloaded | NEW |
onerror | js_script | Script is run when any error occur | NEW |
onhaschange | js_script | Script is run when document has changed | NEW |
onload | js_script | Event fires after the page loading finished | |
onmessage | js_script | Script is run when document goes in offline | NEW |
onoffline | js_script | Script is run when document comes in online | NEW |
onpagehide | js_script | Script is run when document window is hidden | NEW |
onpageshow | js_script | Script is run when document window become visible | NEW |
onpopstate | js_script | Script is run when document window history changes | NEW |
onredo | js_script | Script is run when document perform redo | NEW |
onresize | js_script | Event fires when browser window is resized | NEW |
onstorage | js_script | Script is run when web storage area is updated | NEW |
onundo | js_script | Script is run when document performs undo | NEW |
onunload | js_script | Event fires when browser window has been closed |
Form Events
Form Events triggered by perform some action inside HTML form elements.
Attributes | Value | Description | In HTML5? |
---|---|---|---|
onblur | js_script | Event fire when element loses focus | |
onchange | js_script | Event fire when element value is changed | |
oncontextmenu | js_script | Event fire when context menu is triggered | NEW |
onfocus | js_script | Event fire when element gets focus | |
onformchange | js_script | Event fire when form changes | NEW |
onforminput | js_script | Event fire when form get input field | |
oninput | js_script | Event fire when element get input field | NEW |
oninvalid | js_script | Event fire when element is invalid | NEW |
onreset | js_script | Event fire when clicked on form reset button | REMOVE |
onselect | js_script | Event fire after allow to select text in an element | |
onsubmit | js_script | Event fire when form is submitted |
Keyboard Events
Attributes | Value | Description | In HTML5? |
---|---|---|---|
onkeydown | js_script | Event fire when pressing a key | |
onkeypress | js_script | Event fire when press a key | |
onkeyup | js_script | Event fire when releases a key |
Mouse Events
Mouse Events triggered by mouse action.
Attributes | Value | Description | In HTML5? |
---|---|---|---|
onclick | js_script | Event fire when mouse click on element | |
ondblclick | js_script | Event fire when mouse double click on element | |
ondrag | js_script | Script is run when element is dragged | NEW |
ondragend | js_script | Script is run at end of drag operation | NEW |
ondragenter | js_script | Script is run when element has dragged to a valid drop target | NEW |
ondragleave | js_script | Script is run when element leaves valid drop target | NEW |
ondragover | js_script | Script is run when element is dragged over on valid drop target | NEW |
ondragstart | js_script | Script is run at start of drag operation | NEW |
ondrop | js_script | Script is run when dragged element is dropped | NEW |
onmousedown | js_script | Event fire when mouse button is pressed down on element | |
onmousemove | js_script | Event fire when mouse pointer moves over an element | |
onmouseout | js_script | Event fire when mouse pointer moves out an element | |
onmouseover | js_script | Event fire when mouse pointer moves over on element | |
onmouseup | js_script | Event fire when mouse button is released over an element | |
onmousewheel | js_script | Event fire when mouse wheel being rotated | NEW |
onscroll | js_script | Event fire when element scrollbar being scrolled | NEW |
Media Events
Media Events triggered by common media elements like <img>, <audio>, <embed>, <object>, and <video>.
Attributes | Value | Description | In HTML5? |
---|---|---|---|
onabort | js_script | Script is run when element is abort | |
oncanplay | js_script | Script is run when file is ready for start playing | NEW |
oncanplaythrough | js_script | Script is run when file is played all way without pausing for buffering | NEW |
ondurationchange | js_script | Script is run when media length changes | NEW |
onemptied | js_script | Script is run when something unavailable/disconnects | NEW |
onended | js_script | Script is run when media has reach to end position | NEW |
onerror | js_script | Script is run when error occurs file loaded time | NEW |
onloadeddata | js_script | Script is run when media is loaded | NEW |
onloadedmetadata | js_script | Script is run when meta data are loaded | NEW |
onloadstart | js_script | Script is run when file being loaded | NEW |
onpause | js_script | Script is run when media is paused | NEW |
onplay | js_script | Script is run when media is ready to start playing | NEW |
onplaying | js_script | Script is run when media is actually start for playing | NEW |
onprogress | js_script | Script is run when browser is process of getting media data | NEW |
onratechange | js_script | Script is run when playback rate changes | NEW |
onreadystatechange | js_script | Script is run when ready state changes for each time | NEW |
onseeked | js_script | Script is run when seeking attribute value set to false, that indicate seeking has ended | NEW |
onseeking | js_script | Script is run when seeking attribute value set to true, that indicate seeking has active | NEW |
onstalled | js_script | Script is run when browser is unable to fetch media data for any reason | NEW |
onsuspend | js_script | Script is run when fetching media data is stopped before it is completely loaded for any reason | NEW |
ontimeupdate | js_script | Script is run when playing position has changed | NEW |
onvolumechange | js_script | Script is run each time volume is changed | NEW |
onwaiting | js_script | Script is run when media has paused(for buffer more data) | NEW |