Event
API reference › HTML Attribute › Values › Event
Represents global on* event handler attribute names.
| Case | Value | Description |
|---|---|---|
ABORT | 'onabort' | onabort — Fired when the loading of a resource is aborted (typically media elements). |
ANIMATION_CANCEL | 'onanimationcancel' | onanimationcancel — Fired when a CSS Animation is cancelled. |
ANIMATION_END | 'onanimationend' | onanimationend — Fired when a CSS Animation has completed. |
ANIMATION_ITERATION | 'onanimationiteration' | onanimationiteration — Fired when a CSS Animation repeats an iteration. |
ANIMATION_START | 'onanimationstart' | onanimationstart — Fired when a CSS Animation starts. |
AUX_CLICK | 'onauxclick' | onauxclick — Fired for non-primary button clicks (for example, middle-click/right-click). |
BEFORE_INPUT | 'onbeforeinput' | onbeforeinput — Fired before input occurs, allowing interception of text input. |
BEFORE_MATCH | 'onbeforematch' | onbeforematch — Fired before a user agent attempts to find a match for a find-in-page operation. |
BEFORE_TOGGLE | 'onbeforetoggle' | onbeforetoggle — Fired before a details element is toggled. |
BLUR | 'onblur' | onblur — Fired when an element loses focus. |
CAN_PLAY | 'oncanplay' | oncanplay — Fired when the user agent can play the media, but estimates that not enough data has been loaded to play the media up to its end without interruption. |
CAN_PLAY_THROUGH | 'oncanplaythrough' | oncanplaythrough — Fired when the user agent can play the media up to its end without interruption. |
CANCEL | 'oncancel' | oncancel — Fired when a user cancels an action (for example, cancel event on inputs/dialogs). |
CHANGE | 'onchange' | onchange — Fired when the value of an element changes (for example, input, select elements). |
CLICK | 'onclick' | onclick — Fired when an element is clicked. |
CLOSE | 'onclose' | onclose — Fired when a dialog closes. |
COMMAND | 'oncommand' | oncommand — Fired for command elements when a command is invoked. |
CONTENT_VISIBILITY_AUTO_STATE_CHANGE | 'oncontentvisibilityautostatechange' | oncontentvisibilityautostatechange — Fired when content-visibility autostate changes. |
CONTEXT_LOST | 'oncontextlost' | oncontextlost — Fired when the WebGL context is lost. |
CONTEXT_MENU | 'oncontextmenu' | oncontextmenu — Fired when the context menu is triggered (typically right-click). |
CONTEXT_RESTORED | 'oncontextrestored' | oncontextrestored — Fired when a WebGL context is restored. |
COPY | 'oncopy' | oncopy — Fired when a copy operation is performed. |
CUE_CHANGE | 'oncuechange' | oncuechange — Fired when the cue changes in a media track. |
CUT | 'oncut' | oncut — Fired when a cut operation is performed. |
DOUBLE_CLICK | 'ondblclick' | ondblclick — Fired when an element is double-clicked. |
DRAG | 'ondrag' | ondrag — Fired continuously during a drag operation. |
DRAG_END | 'ondragend' | ondragend — Fired when a drag operation ends. |
DRAG_ENTER | 'ondragenter' | ondragenter — Fired when a dragged item enters a valid drop target. |
DRAG_LEAVE | 'ondragleave' | ondragleave — Fired when a dragged item leaves a valid drop target. |
DRAG_OVER | 'ondragover' | ondragover — Fired when a dragged item is being dragged over a valid drop target. |
DRAG_START | 'ondragstart' | ondragstart — Fired when a drag operation is initiated. |
DROP | 'ondrop' | ondrop — Fired when an item is dropped on a valid drop target. |
DURATION_CHANGE | 'ondurationchange' | ondurationchange — Fired when the duration attribute of media changes. |
EMPTIED | 'onemptied' | onemptied — Fired when the media has been emptied. |
ENDED | 'onended' | onended — Fired when playback has stopped because the end of the media was reached. |
ERROR | 'onerror' | onerror — Fired when a resource failed to load or an error occurs. |
FOCUS | 'onfocus' | onfocus — Fired when an element receives focus. |
FOCUS_IN | 'onfocusin' | onfocusin — Fired when an element or its descendants receive focus (bubbles). |
FOCUS_OUT | 'onfocusout' | onfocusout — Fired when an element or its descendants lose focus (bubbles). |
FORM_DATA | 'onformdata' | onformdata — Fired when a FormData object is constructed from a form. |
FULLSCREEN_CHANGE | 'onfullscreenchange' | onfullscreenchange — Fired when an element enters or exits fullscreen. |
FULLSCREEN_ERROR | 'onfullscreenerror' | onfullscreenerror — Fired when a request to switch to fullscreen fails. |
GESTURE_CHANGE | 'ongesturechange' | ongesturechange — Non-standard: gesture change event (touch/gesture APIs). |
GESTURE_END | 'ongestureend' | ongestureend — Non-standard: gesture end event. |
GESTURE_START | 'ongesturestart' | ongesturestart — Non-standard: gesture start event. |
GOT_POINTER_CAPTURE | 'ongotpointercapture' | ongotpointercapture — Fired when an element receives pointer capture. |
INPUT | 'oninput' | oninput — Fired every time the value of an <input>, <textarea> or element with contenteditable changes. |
INVALID | 'oninvalid' | oninvalid — Fired when a submittable element is invalid. |
KEY_DOWN | 'onkeydown' | onkeydown — Fired when a key is pressed down. |
KEY_PRESS | 'onkeypress' | onkeypress — (Deprecated) Fired when a key that produces a character value is pressed down. |
KEY_UP | 'onkeyup' | onkeyup — Fired when a key is released. |
LOAD | 'onload' | onload — Fired when the resource and its dependent resources have finished loading. |
LOAD_START | 'onloadstart' | onloadstart — Fired when the browser starts looking for the media data. |
LOADED_DATA | 'onloadeddata' | onloadeddata — Fired when the media’s first frame is available. |
LOADED_METADATA | 'onloadedmetadata' | onloadedmetadata — Fired when metadata for the media has been loaded. |
LOST_POINTER_CAPTURE | 'onlostpointercapture' | onlostpointercapture — Fired when an element loses pointer capture. |
MOUSE_DOWN | 'onmousedown' | onmousedown — Fired when a pointing device button is pressed on an element. |
MOUSE_ENTER | 'onmouseenter' | onmouseenter — Fired when the pointing device is moved onto the element. |
MOUSE_LEAVE | 'onmouseleave' | onmouseleave — Fired when the pointing device is moved off the element. |
MOUSE_MOVE | 'onmousemove' | onmousemove — Fired when the pointing device is moved while over an element. |
MOUSE_OUT | 'onmouseout' | onmouseout — Fired when the pointing device is moved off the element or one of its children. |
MOUSE_OVER | 'onmouseover' | onmouseover — Fired when the pointing device is moved onto an element or one of its children. |
MOUSE_UP | 'onmouseup' | onmouseup — Fired when a pointing device button is released over an element. |
MOUSE_WHEEL | 'onmousewheel' | onmousewheel — Deprecated/Non-standard: mouse wheel scrolling event. |
PASTE | 'onpaste' | onpaste — Fired when a paste action is performed. |
PAUSE | 'onpause' | onpause — Fired when media playback is paused. |
PLAY | 'onplay' | onplay — Fired when media playback is started. |
PLAYING | 'onplaying' | onplaying — Fired when playback is ready to start after having been paused or delayed due to buffering. |
POINTER_CANCEL | 'onpointercancel' | onpointercancel — Fired when the browser determines that a pointer will no longer be able to generate events. |
POINTER_DOWN | 'onpointerdown' | onpointerdown — Fired when a pointer becomes active (pressed) on an element. |
POINTER_ENTER | 'onpointerenter' | onpointerenter — Fired when a pointer enters the bounding box of an element. |
POINTER_LEAVE | 'onpointerleave' | onpointerleave — Fired when a pointer leaves the bounding box of an element. |
POINTER_MOVE | 'onpointermove' | onpointermove — Fired when a pointer changes coordinates over an element. |
POINTER_OUT | 'onpointerout' | onpointerout — Fired when a pointer moves out of an element. |
POINTER_OVER | 'onpointerover' | onpointerover — Fired when a pointer moves over an element. |
POINTER_RAW_UPDATE | 'onpointerrawupdate' | onpointerrawupdate — Fired for low-level pointer raw updates (experimental). |
POINTER_UP | 'onpointerup' | onpointerup — Fired when a pointer is no longer active (released) on an element. |
PROGRESS | 'onprogress' | onprogress — Fired periodically to report progress of media downloading. |
RATE_CHANGE | 'onratechange' | onratechange — Fired when the playback rate changes. |
RESET | 'onreset' | onreset — Fired when a form is reset. |
RESIZE | 'onresize' | onresize — Fired when an element’s size changes (for example, video resize events). |
SCROLL | 'onscroll' | onscroll — Fired when an element is scrolled. |
SCROLL_END | 'onscrollend' | onscrollend — Fired when scrolling ends (scroll end event). |
SCROLL_SNAP_CHANGE | 'onscrollsnapchange' | onscrollsnapchange — Experimental: Fired when scroll snap position changes. |
SCROLL_SNAP_CHANGING | 'onscrollsnapchanging' | onscrollsnapchanging — Experimental: Fired while scroll snap is changing. |
SECURITY_POLICY_VIOLATION | 'onsecuritypolicyviolation' | onsecuritypolicyviolation — Fired when a Content Security Policy violation occurs. |
SEEKED | 'onseeked' | onseeked — Fired when a seek operation completes. |
SEEKING | 'onseeking' | onseeking — Fired when a seek operation begins. |
SELECT | 'onselect' | onselect — Fired when text selection is made in an input or textarea. |
SELECT_START | 'onselectstart' | onselectstart — Fired when the user starts a selection. |
SELECTION_CHANGE | 'onselectionchange' | onselectionchange — Fired when the selection on the document changes. |
SLOT_CHANGE | 'onslotchange' | onslotchange — Fired when the assigned nodes of a slot change. |
STALLED | 'onstalled' | onstalled — Fired when the user agent is trying to fetch media data, but data is unexpectedly not forthcoming. |
SUBMIT | 'onsubmit' | onsubmit — Fired when a form is submitted. |
SUSPEND | 'onsuspend' | onsuspend — Fired when the user agent intentionally does not fetch media data for a period. |
TIME_UPDATE | 'ontimeupdate' | ontimeupdate — Fired when the current playback position changed. |
TOGGLE | 'ontoggle' | ontoggle — Fired when a <details> element is opened or closed. |
TOUCH_CANCEL | 'ontouchcancel' | ontouchcancel — Fired when a touch point has been disrupted in an implementation-specific manner. |
TOUCH_END | 'ontouchend' | ontouchend — Fired when a touch point is removed from the touch surface. |
TOUCH_MOVE | 'ontouchmove' | ontouchmove — Fired when a touch point is moved along the touch surface. |
TOUCH_START | 'ontouchstart' | ontouchstart — Fired when a touch point is placed on the touch surface. |
TRANSITION_CANCEL | 'ontransitioncancel' | ontransitioncancel — Fired when a CSS transition is cancelled. |
TRANSITION_END | 'ontransitionend' | ontransitionend — Fired when a CSS transition has completed. |
TRANSITION_RUN | 'ontransitionrun' | ontransitionrun — Fired when a CSS transition is about to start running. |
TRANSITION_START | 'ontransitionstart' | ontransitionstart — Fired when a CSS transition starts. |
VOLUME_CHANGE | 'onvolumechange' | onvolumechange — Fired when the volume has changed (media elements). |
WAITING | 'onwaiting' | onwaiting — Fired when playback has stopped because of a temporary lack of data. |
WEBKIT_MOUSE_FORCE_CHANGED | 'onwebkitmouseforcechanged' | onwebkitmouseforcechanged — Non-standard WebKit force change event. |
WEBKIT_MOUSE_FORCE_DOWN | 'onwebkitmouseforcedown' | onwebkitmouseforcedown — Non-standard WebKit force down event. |
WEBKIT_MOUSE_FORCE_UP | 'onwebkitmouseforceup' | onwebkitmouseforceup — Non-standard WebKit force up event. |
WEBKIT_MOUSE_FORCE_WILL_BEGIN | 'onwebkitmouseforcewillbegin' | onwebkitmouseforcewillbegin — Non-standard WebKit event fired when mouse force will begin. |
WHEEL | 'onwheel' | onwheel — Fired when a wheel button of a pointing device is rotated. |