About
An event is categorize by its type which is a property of the event object
The type of an event is also known as the name of the event (Ref)
Example
With the load event
Example with the load event.
window.onload = (event) => { console.log("The event type is "+event.type); };
How to create your own?
To see this example, we have a dedicated page
List
Event Handler Attribute or Property Name | Event type | Description | |
---|---|---|---|
onabort | abort | ||
onblur | blur | The onblur event occurs when an element loses focus either by the pointing device or by tabbing navigation. It may be used with the same elements as onfocus. | |
oncancel | cancel | ||
oncanplay | canplay | ||
oncanplaythrough | canplaythrough | ||
onchange | change | The change event occurs when a control loses the input focus and its value has been modified since gaining focus. This attribute applies to the following elements: INPUT, SELECT, and TEXTAREA. | |
onclick | click | The click event occurs when the pointing device button is clicked over an element. This attribute may be used with most elements. | |
oncontextmenu | contextMenu | Right click | |
oncuechange | cuechange | ||
ondblclick | dblclick | The ondblclick event occurs when the pointing device button is double-clicked over an element. This attribute may be used with most elements. | |
ondurationchange | durationchange | ||
onemptied | emptied | ||
onended | ended | ||
onfocus | focus | The focus event occurs when an element receives focus either by the pointing device or by tabbing navigation. This attribute may be used with the following elements: A, AREA, LABEL, INPUT, SELECT, TEXTAREA, and BUTTON. | |
oninput | input | ||
oninvalid | invalid | ||
onkeydown | keydown | The onkeydown event occurs when a key is pressed down. This attribute may be used with most elements. | |
onkeypress | keypress | The onkeypress event occurs when a key is pressed and released over an element. This attribute may be used with most elements. | |
onkeyup | keyup | The onkeyup event occurs when a key is released over an element. This attribute may be used with most elements. | |
onload | load | The load event occurs when the user agent finishes loading a window or all frames within a FRAMESET. This attribute may be used with BODY and FRAMESET elements. | |
onloadeddata | loadeddata | ||
onloadedmetadata | loadedmetadata | ||
onloadstart | loadstart | ||
onmousehold | mousehold | This event does not exist but can be created with mousedown and mouseup. The gesture is also known as pan (ie panleft, panright, …) | |
onmousedown | mousedown | The onmousedown event occurs when the pointing device button is pressed. | |
onmouseup | mouseup | The onmouseup event occurs when the pointing device button is released. | |
onmouseenter | mouseenter | when the mouse enters the space of an element | |
onmouseleave | mouseleave | when the mouse leaves the space of an element | |
onmousemove | mousemove | The onmousemove event occurs when the pointing device is moved while it is over an element. This attribute may be used with most elements. | |
onmouseout | mouseout | The onmouseout event occurs when the pointing device is moved away from an element. This attribute may be used with most elements. | |
onmouseover | mouseover | ||
onmouseover | mouseover | The mouseover event occurs when the pointing device is moved onto an element. This attribute may be used with most elements. | |
onmousewheel | mousewheel | ||
onpause | pause | ||
onplay | play | ||
onplaying | playing | ||
onprogress | progress | ||
onratechange | ratechange | ||
onreset | reset | The onreset event occurs when a form is reset. It only applies to the FORM element. | |
resize | The resize event occurs when the windows is resized | ||
None | scroll | When the page content goes up or down | |
onseeked | seeked | ||
onseeking | seeking | ||
onselect | select | The onselect event occurs when a user selects some text in a text field. This attribute may be used with the INPUT and TEXTAREA elements. | |
selectstart | At the start of a text selection: see Browser selection | ||
onshow | show | ||
onstalled | stalled | ||
storage | Listen to Local web storage | ||
onsubmit | submit | The submit event occurs when a form is submitted. It only applies to the FORM element. | |
onsuspend | suspend | ||
ontimeupdate | timeupdate | ||
ontoggle | toggle | ||
onunload | unload | The onunload event occurs when the user agent removes a document from a window or frame. This attribute may be used with BODY and FRAMESET elements. | |
onvolumechange | volumechange | ||
onwaiting | waiting |
Library
Hammer
and more
Documentation / Reference
The most known event:
- on this table : Events
- on this page: en-US/docs/Web/API/GlobalEventHandlers