DOM event reference

  • Revision slug: DOM/DOM_event_reference
  • Revision title: DOM event reference
  • Revision id: 6269
  • Created:
  • Creator: Masayuki
  • Is current revision? No
  • Comment target of composition events and textinput event is Element; 24 words added

Revision Content

{{ draft() }}

Following events can be captured by adding event handlers by calling a DOM element's {{ domxref("element.addEventListener()") }} method.

Note: This page needs content, and the child pages need filling out.

DOM events

Event name Event type Targets Description
{{ domevent("DOMActivate") }}     Specification: W3C Draft
{{ domevent("DOMAttrModified") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft
{{ domevent("DOMAttributeNameChanged") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft
{{ domevent("DOMCharacterDataModified") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft
{{ domevent("DOMContentLoaded") }} ?   Specification: HTML5
{{ domevent("DOMElementNameChanged") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft
{{ domevent("DOMFocusIn") }}     Specification: W3C Draft
{{ domevent("DOMFocusOut") }}     Specification: W3C Draft
{{ domevent("DOMNodeInserted") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft
{{ domevent("DOMNodeInsertedIntoDocument") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft
{{ domevent("DOMNodeRemoved") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft
{{ domevent("DOMNodeRemovedFromDocument") }} {{ domxref("MutationEvent") }}   Specification: W3C Draft {{ deprecated_inline() }}
{{ domevent("DOMSubtreeModified") }} {{ domxref("MutationEvent") }}   A general event for notifications of any changes to the document. Specification: (W3C Draft) {{ deprecated_inline() }}
{{ domevent("abort") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Fired when the user abort the download of a resource.
{{ domevent("afterprint") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }} Fired after printing a document has finished. See Detecting print requests for an example. {{ gecko_minversion_inline("6.0") }}
{{ domevent("beforeprint") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }} Fired before printing of a document begins. See Detecting print requests for an example. {{ gecko_minversion_inline("6.0") }}
{{ domeventxref("beforeunload") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }} IE-specific. Fired before a resource is unloaded (while unload is fired afterward)
{{ domevent("blur") }} {{ domxref("FocusEvent") }} {{ domxref("Element") }} (except <body> and <frameseet>), {{ domxref("Document") }} Fired when an element target loses focus.
{{ domevent("canplay") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("canplaythrough") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("click") }} {{ domxref("MouseEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Specification: W3C Draft
{{ domeventxref("compositionend") }} {{ domxref("CompositionEvent") }} {{ domxref("Element") }} Specification: W3C Draft {{ gecko_minversion_inline("9.0") }}
{{ domeventxref("compositionstart") }} {{ domxref("CompositionEvent") }} {{ domxref("Element") }} Specification: W3C Draft {{ gecko_minversion_inline("9.0") }}
{{ domeventxref("compositionupdate") }} {{ domxref("CompositionEvent") }} {{ domxref("Element") }} Specification: W3C Draft {{ gecko_minversion_inline("9.0") }}
{{ domevent("contextmenu") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("cuechange") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("dblclick") }} {{ domxref("MouseEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Specification: W3C Draft
{{ domevent("drag") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("dragend") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("dragenter") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("dragleave") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("dragover") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("dragstart") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("drop") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("durationchange") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("emptied") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("ended") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domeventxref("error") }} {{ domxref("UIEvent") }} {{ domxref("Element") }} (except <body> and <frameseet>), {{ domxref("Document") }}, {{ domxref("Window") }} Fired when a resource fails to load (network error, script execution error, etc). Specification: W3C Draft
{{ domevent("focus") }} {{ domxref("FocusEvent") }} {{ domxref("Element") }} (except <body> and <frameseet>), {{ domxref("Document") }}, {{ domxref("Window") }} Fired when an element receives focus. Specification: W3C Draft
{{ domevent("focusin") }} {{ domxref("FocusEvent") }}   Fired when an event target is about to receive focus but before the focus is shifted. This event occurs right before the focus event. Specification: W3C Draft
{{ domevent("focusout") }} {{ domxref("FocusEvent") }}   Fired when an event target is about to lose focus but before the focus is shifted. This event occurs right before the blur event. Specification: W3C Draft
{{ domevent("hashchange") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}  
{{ domeventxref("input") }} {{ domxref("Event") }} {{ domxref("Element") }} Specification: HTML5
{{ domevent("invalid") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("keydown") }} {{ domxref("KeyboardEvent") }}   Fired when a key is initially pressed. This is sent after any key mapping is performed, but before any input method editors receive the keypress. This is sent for any key, even if it doesn't generate a character code. Specification: W3C Draft
{{ domevent("keypress") }} {{ domxref("KeyboardEvent") }}  

Fired when a key is initially pressed, but only if that key normally produces a character value. This is sent after any key mapping is performed, but before any input method editors receive the keypress. Specification: W3C Draft

Note: This is sent in addition to, not instead of, the {{ domevent("keydown") }} event.

This event has been deprecated in favor of {{ domevent("textinput") }}.

{{ domevent("keyup") }} {{ domxref("KeyboardEvent") }}   Fired when a key is released. This is sent after any key mapping is performed, and always follows the corresponding {{ domevent("keydown") }} and {{ domevent("keypress") }} events. Specification: W3C Draft
{{ domevent("load") }} {{ domxref("UIEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Fired when the resource (document, element, defaultView) and depending resources (images, script downloading and execution, css loading, etc.) are loaded. Specification: W3C Draft
{{ domevent("loadeddata") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("loadedmetadata") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("loadstart") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("message") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}  
{{ domevent("mousedown") }} {{ domxref("MouseEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Specification: W3C Draft
{{ domeventxref("mouseenter") }} {{ domxref("MouseEvent") }}   Fired when entering an element or any of its descendants. Specification: W3C Draft
{{ domeventxref("mouseleave") }} {{ domxref("MouseEvent") }}   Fired when leaving an element and all of its descendants. Specification: W3C Draft
{{ domevent("mousemove") }} {{ domxref("MouseEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Specification: W3C Draft
{{ domevent("mouseout") }} {{ domxref("MouseEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Specification: W3C Draft
{{ domevent("mouseover") }} {{ domxref("MouseEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Specification: W3C Draft
{{ domevent("mouseup") }} {{ domxref("MouseEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Specification: W3C Draft
{{ domevent("mousewheel") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("mozfullscreenchange") }}     Sent to an element when it's granted full-screen mode, or to a document when it leaves full-screen mode.
{{ domevent("offline") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }} Can be used on window, document, or document.body, see Online_and_offline_events. Specification: WHATWG HTML 5 DRAFT {{ gecko_minversion_inline("1.9") }}
{{ domevent("online") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }} Can be used on window, document, or document.body, see Online_and_offline_events. Specification: WHATWG HTML 5 DRAFT {{ gecko_minversion_inline("1.9") }}
{{ domevent("pagehide") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}  
{{ domevent("pageshow") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}  
{{ domevent("pause") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("play") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("playing") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("popstate") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}  
{{ domevent("progress") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("ratechange") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("readystatechange") }}   {{ domxref("Document") }}  
{{ domevent("reset") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("resize") }} {{ domxref("UIEvent") }} {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }} Fired when the browser window is resized. May apply to <iframe>s. Specification: W3C Draft
{{ domevent("scroll") }} {{ domxref("UIEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Fired when a user scrolls a document or an element. Specification: W3C Draft
{{ domevent("seeked") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("seeking") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("select") }} {{ domxref("UIEvent") }} {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }} Fired when a user selects some text. Specification: W3C Draft
{{ domevent("show") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("stalled") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("storage") }}   {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}  
{{ domevent("submit") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("suspend") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("textinput") }} {{ domxref("TextInput") }} {{ domxref("Element") }} Similar to keypress, except it works with all text input methods and not just keyboards. Pasting text into an input box may also fire this event. Specification: W3C Draft {{ unimplemented_inline() }}
{{ domevent("timeupdate") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("unload") }} {{ domxref("UIEvent") }} {{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }} Fired when the resource (document, element, defaultView) or any depending resources (images, CSS file, etc.) is removed from the environment. Specification: W3C Draft
{{ domevent("volumechange") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  
{{ domevent("waiting") }}   {{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}  

Specifications

DOM Level 3 Events (W3C Working Draft)

See also

{{ languages( { "ja": "ja/DOM/DOM_event_reference" } ) }}

Revision Source

<p>{{ draft() }}</p>
<p>Following events can be captured by adding event handlers by calling a DOM element's {{ domxref("element.addEventListener()") }} method.</p>
<div class="note"><strong>Note:</strong> This page needs content, and the child pages need filling out.</div>
<h2>DOM events</h2>
<table class="standard-table" style="width: auto;"> <tbody> <tr> <td class="header">Event name</td> <td class="header">Event type</td> <td class="header">Targets</td> <td class="header">Description</td> </tr> <tr> <td>{{ domevent("DOMActivate") }}</td> <td> </td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMActivate">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMAttrModified") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMAttrModified">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMAttributeNameChanged") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMAttributeNameChanged">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMCharacterDataModified") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMCharacterDataModified">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMContentLoaded") }}</td> <td>?</td> <td> </td> <td>Specification: <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-end.html#the-end">HTML5</a></td> </tr> <tr> <td>{{ domevent("DOMElementNameChanged") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMElementNameChanged">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMFocusIn") }}</td> <td> </td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMFocusIn">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMFocusOut") }}</td> <td> </td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMFocusOut">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMNodeInserted") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeInserted">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMNodeInsertedIntoDocument") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeInsertedIntoDocument">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMNodeRemoved") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeRemoved">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("DOMNodeRemovedFromDocument") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMNodeRemovedFromDocument">W3C Draft</a> {{ deprecated_inline() }}</td> </tr> <tr> <td>{{ domevent("DOMSubtreeModified") }}</td> <td>{{ domxref("MutationEvent") }}</td> <td> </td> <td>A general event for notifications of any changes to the document. Specification: (<a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-DOMSubtreeModified">W3C Draft</a>) {{ deprecated_inline() }}</td> </tr> <tr> <td>{{ domevent("abort") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Fired when the user abort the download of a resource.</td> </tr> <tr> <td>{{ domevent("afterprint") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td>Fired after printing a document has finished. See <a href="/en/Printing#Detecting_print_requests" title="https://developer.mozilla.org/en/Printing#Detecting_print_requests">Detecting print requests</a> for an example. {{ gecko_minversion_inline("6.0") }}</td> </tr> <tr> <td>{{ domevent("beforeprint") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td>Fired before printing of a document begins. See <a href="/en/Printing#Detecting_print_requests" title="https://developer.mozilla.org/en/Printing#Detecting_print_requests">Detecting print requests</a> for an example. {{ gecko_minversion_inline("6.0") }}</td> </tr> <tr> <td>{{ domeventxref("beforeunload") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td>IE-specific. Fired before a resource is unloaded (while unload is fired afterward)</td> </tr> <tr> <td>{{ domevent("blur") }}</td> <td>{{ domxref("FocusEvent") }}</td> <td>{{ domxref("Element") }} (except <code>&lt;body&gt;</code> and <code>&lt;frameseet&gt;</code>), {{ domxref("Document") }}</td> <td>Fired when an element target loses focus.</td> </tr> <tr> <td>{{ domevent("canplay") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("canplaythrough") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("click") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-click">W3C Draft</a></td> </tr> <tr> <td>{{ domeventxref("compositionend") }}</td> <td>{{ domxref("CompositionEvent") }}</td> <td>{{ domxref("Element") }}</td> <td>Specification: <a class="external" href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-compositionend">W3C Draft</a> {{ gecko_minversion_inline("9.0") }}</td> </tr> <tr> <td>{{ domeventxref("compositionstart") }}</td> <td>{{ domxref("CompositionEvent") }}</td> <td>{{ domxref("Element") }}</td> <td>Specification: <a class="external" href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-compositionstart">W3C Draft</a> {{ gecko_minversion_inline("9.0") }}</td> </tr> <tr> <td>{{ domeventxref("compositionupdate") }}</td> <td>{{ domxref("CompositionEvent") }}</td> <td>{{ domxref("Element") }}</td> <td>Specification: <a class="external" href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-compositionupdate">W3C Draft</a> {{ gecko_minversion_inline("9.0") }}</td> </tr> <tr> <td>{{ domevent("contextmenu") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("cuechange") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("dblclick") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-dblclick">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("drag") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("dragend") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("dragenter") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("dragleave") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("dragover") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("dragstart") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("drop") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("durationchange") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("emptied") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("ended") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domeventxref("error") }}</td> <td>{{ domxref("UIEvent") }}</td> <td>{{ domxref("Element") }} (except <code>&lt;body&gt;</code> and <code>&lt;frameseet&gt;</code>), {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Fired when a resource fails to load (network error, script execution error, etc). Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-error">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("focus") }}</td> <td>{{ domxref("FocusEvent") }}</td> <td>{{ domxref("Element") }} (except <code>&lt;body&gt;</code> and <code>&lt;frameseet&gt;</code>), {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Fired when an element receives focus. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-focus">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("focusin") }}</td> <td>{{ domxref("FocusEvent") }}</td> <td> </td> <td>Fired when an event target is about to receive focus but before the focus is shifted. This event occurs right before the focus event. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-focusin">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("focusout") }}</td> <td>{{ domxref("FocusEvent") }}</td> <td> </td> <td>Fired when an event target is about to lose focus but before the focus is shifted. This event occurs right before the blur event. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-focusout">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("hashchange") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td> </td> </tr> <tr> <td>{{ domeventxref("input") }}</td> <td>{{ domxref("Event") }}</td> <td>{{ domxref("Element") }}</td> <td>Specification: <a class="external" href="http://dev.w3.org/html5/spec/common-input-element-apis.html#common-event-behaviors" title="http://dev.w3.org/html5/spec/common-input-element-apis.html#common-event-behaviors">HTML5</a></td> </tr> <tr> <td>{{ domevent("invalid") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("keydown") }}</td> <td>{{ domxref("KeyboardEvent") }}</td> <td> </td> <td>Fired when a key is initially pressed. This is sent after any key mapping is performed, but before any input method editors receive the keypress. This is sent for any key, even if it doesn't generate a character code. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-keydown">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("keypress") }}</td> <td>{{ domxref("KeyboardEvent") }}</td> <td> </td> <td> <p>Fired when a key is initially pressed, but only if that key normally produces a character value. This is sent after any key mapping is performed, but before any input method editors receive the keypress. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-keypress">W3C Draft</a></p> <div class="note"><strong>Note:</strong> This is sent in addition to, not instead of, the {{ domevent("keydown") }} event.</div> <p>This event has been deprecated in favor of {{ domevent("textinput") }}.</p> </td> </tr> <tr> <td>{{ domevent("keyup") }}</td> <td>{{ domxref("KeyboardEvent") }}</td> <td> </td> <td>Fired when a key is released. This is sent after any key mapping is performed, and always follows the corresponding {{ domevent("keydown") }} and {{ domevent("keypress") }} events. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-keyup">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("load") }}</td> <td>{{ domxref("UIEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Fired when the resource (document, element, defaultView) and depending resources (images, script downloading and execution, css loading, etc.) are loaded. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-load">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("loadeddata") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("loadedmetadata") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("loadstart") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("message") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("mousedown") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mousedown">W3C Draft</a></td> </tr> <tr> <td>{{ domeventxref("mouseenter") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td> </td> <td>Fired when entering an element or any of its descendants. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseenter">W3C Draft</a></td> </tr> <tr> <td>{{ domeventxref("mouseleave") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td> </td> <td>Fired when leaving an element and all of its descendants. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseleave">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("mousemove") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mousemove">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("mouseout") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseout">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("mouseover") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseover">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("mouseup") }}</td> <td>{{ domxref("MouseEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-mouseup">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("mousewheel") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("mozfullscreenchange") }}</td> <td> </td> <td> </td> <td>Sent to an element when it's granted full-screen mode, or to a document when it leaves full-screen mode.</td> </tr> <tr> <td>{{ domevent("offline") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td>Can be used on window, document, or document.body, see <a href="/en/Online_and_offline_events" title="en/Online_and_offline_events">Online_and_offline_events</a>. Specification: <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#offline">WHATWG HTML 5 DRAFT</a> {{ gecko_minversion_inline("1.9") }}</td> </tr> <tr> <td>{{ domevent("online") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td>Can be used on window, document, or document.body, see <a href="/en/Online_and_offline_events" title="en/Online_and_offline_events">Online_and_offline_events</a>. Specification: <a class="external" href="http://www.whatwg.org/specs/web-apps/current-work/#offline">WHATWG HTML 5 DRAFT</a> {{ gecko_minversion_inline("1.9") }}</td> </tr> <tr> <td>{{ domevent("pagehide") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("pageshow") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("pause") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("play") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("playing") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("popstate") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("progress") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("ratechange") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("readystatechange") }}</td> <td> </td> <td>{{ domxref("Document") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("reset") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("resize") }}</td> <td>{{ domxref("UIEvent") }}</td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td>Fired when the browser window is resized. May apply to &lt;iframe&gt;s. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-resize">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("scroll") }}</td> <td>{{ domxref("UIEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Fired when a user scrolls a document or an element. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-scroll">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("seeked") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("seeking") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("select") }}</td> <td>{{ domxref("UIEvent") }}</td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td>Fired when a user selects some text. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-select">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("show") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("stalled") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("storage") }}</td> <td> </td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("submit") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("suspend") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("textinput") }}</td> <td>{{ domxref("TextInput") }}</td> <td>{{ domxref("Element") }}</td> <td>Similar to <code>keypress</code>, except it works with all text input methods and not just keyboards. Pasting text into an input box may also fire this event. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-textInput">W3C Draft</a> {{ unimplemented_inline() }}</td> </tr> <tr> <td>{{ domevent("timeupdate") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("unload") }}</td> <td>{{ domxref("UIEvent") }}</td> <td>{{ domxref("Window") }}, {{ HTMLElement("body") }}, {{ HTMLElement("frameset") }}</td> <td>Fired when the resource (document, element, defaultView) or any depending resources (images, CSS file, etc.) is removed from the environment. Specification: <a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/#event-type-unload">W3C Draft</a></td> </tr> <tr> <td>{{ domevent("volumechange") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> <tr> <td>{{ domevent("waiting") }}</td> <td> </td> <td>{{ domxref("Element") }}, {{ domxref("Document") }}, {{ domxref("Window") }}</td> <td> </td> </tr> </tbody>
</table>
<h2>Specifications</h2>
<p><a class="external" href="http://www.w3.org/TR/DOM-Level-3-Events/">DOM Level 3 Events</a> (W3C Working Draft)</p>
<h2>See also</h2>
<ul> <li><a href="/en/DOM/element#Event_Handlers" title="en/DOM/element#Event_Handlers">DOM Reference: Event Handlers</a> (on*)</li> <li><a href="/en/Gecko-Specific_DOM_Events" title="en/Gecko-Specific_DOM_Events">Gecko-Specific DOM Events</a></li> <li><a href="/en/XUL/Events" title="en/XUL/Events">XUL Events</a></li>
</ul>
<p>{{ languages( { "ja": "ja/DOM/DOM_event_reference" } ) }}</p>
Revert to this revision