Whenever a user visits any website they do things such as clicking on the text and images or the given links, hover over certain things etc. all these are examples of JavaScript call events.
These event handlers can be written in JavaScript or VBScript where you can specify the event handlers as a value of the event tag attribute.
Event Attribute | Description |
---|
onabort | It triggers on an abort event. |
onchange | It triggers when an element changes. |
oncontextmenu | It triggers when a context menu is triggered. |
onerror | It triggers when an error occurs. |
onforminput | It triggers when a form gets user input. |
onformchange | It triggers when a form changes. |
oninput | It triggers when an element gets the input from user. |
oninvalid | It triggers when an element is invalid. |
onmessage | It triggers when the message is triggered. |
onreadystatechange | It triggers when the ready-state changes. |
onscroll | It triggers when an element's scrollbar is being scrolled. |
onselect | It triggers when an element is selected. |
onsubmit | It triggers when a form is submitted. |
Event Attribute | Description |
---|
ondrag | It triggers when an element is dragged. |
ondragenter | It triggers when an element has been dragged to a valid drop target. |
ondragend | It triggers at the end of the drag operation. |
ondragover | It triggers when an element is being dragged over a valid drop target. |
ondragleave | It triggers when an element leaves a valid drop target. |
ondragstart | It triggers at the start of a drag operation. |
ondrop | It triggers when dragged element is being dropped. |
Event Attribute | Description |
---|
onload | It triggers when the document loads. |
onloadedmetadata | It triggers when the duration and other media data of a media element is loaded. |
onloadeddata | It triggers when the media data is loaded. |
onloadstart | It triggers when the browser starts to load the media data. |
Event Attribute | Description |
---|
onclick | It triggers on a mouse click. |
ondblclick | It triggers on a mouse double-click. |
onmousemove | It triggers when the mouse pointer moves. |
onmousedown | It triggers when the mouse button is pressed. |
onmouseout | It triggers when the mouse pointer moves out of an element. |
onmouseover | It triggers when the mouse pointer moves over an element. |
onmouseup | It triggers when a mouse button is released. |
onmousewheel | It triggers when the mouse wheel is rotated. |
Event Attribute | Description |
---|
onkeypress | It triggers when a key is pressed and released. |
onkeyup | It triggers when a key is released. |
onkeydown | It triggers when a key is pressed. |
Event Attribute | Description |
---|
offline | It triggers when the document goes offline. |
onafterprint | It triggers after the document is printed. |
onbeforeprint | It triggers before the document is printed. |
onbeforeonload | It triggers before the document loads. |
onhaschange | It triggers when the document has a change. |
onoffline | It triggers when the document goes offline. |
onoine | It triggers when the document comes online. |
ononline | It triggers when the document comes online. |
onredo | It triggers when the document performs a redo. |
onunload | It triggers when the user leaves the document. |
onundo | It triggers when a document performs an undo. |
onstorage | It triggers when a document loads. |
Event Attribute | Description |
---|
onblur | It triggers when the window loses focus. |
onfocus | It triggers when the window gets a focus. |
onpageshow | It triggers when the window becomes visible. |
onpagehide | It triggers when the window is hidden. |
onresize | It triggers when the window is resized. |
onpopstate | It triggers when the history of the window changes. |
Event Attribute | Description |
---|
oncanplay | It triggers when the media can start play, but might stop for buffering. |
oncanplaythrough | It triggers when media can be played till the end without stopping or buffering. |
onemptied | It triggers when a media resource element suddenly becomes empty. |
ondurationchange | It triggers when the length of the media is changed. |
onended | It triggers when the media reaches to an end. |
onplay | It triggers when the media will start playing. |
onpause | It triggers when the media is paused. |
onplaying | It triggers when media starts playing. |
onprogress | It triggers when the browser is fetching the media data. |
onratechange | It triggers when the playing rate of media data has changed. |
onseeked | It triggers when the media element's seeking attribute is no longer true and the seeking has begun. |
onseeking | It triggers when the media element's seeking attribute is true and the seeking has begun. |
onstalled | It triggers when there is an error in the fetching media data. |
ontimeupdate | It triggers when media changes its playing position. |
onsuspend | It triggers when the browser is fetching media data but stopped before the entire media file was fetched. |
onwaiting | It triggers when the media has stopped playing, but is expected to resume. |
onvolumechange | It triggers when media changes the volume also when the volume is set to “mute”. |