Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
DOM event
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Events == === HTML events === ==== Common events ==== There is a huge collection of events that can be generated by most element nodes: * [[Computer mouse|Mouse]] events.<ref>{{cite web|url=http://www.w3.org/TR/2010/WD-html5-20101019/dnd.html#the-dragevent-and-datatransfer-interfaces|title=7.8 Drag and drop β HTML5}}</ref><ref>{{cite web|url=https://developer.mozilla.org/en-US/docs/DragDrop/Drag_and_Drop|title=HTML Drag and Drop API|date=28 March 2024 }}</ref> * [[Computer keyboard|Keyboard]] events. * HTML frame/object events. * HTML form events. * User interface events. * Mutation events (notification of any changes to the structure of a document). * Progress events<ref>{{cite web|url=http://www.w3.org/TR/progress-events/|title=Progress Events}}</ref> (used by [[XMLHttpRequest]] and File API<ref>{{cite web|url=http://www.w3.org/TR/FileAPI/#events|title=File API}}</ref>). Note that the event classification above is not exactly the same as W3C's classification. {| class="wikitable" ! Category ! [[#DOM Level 2|Type]] ! [[#DOM Level 0|Attribute]] ! Description ! Bubbles ! Cancelable |- | rowspan=14 | Mouse | click | onclick | Fires when the [[pointing device]] button is clicked over an element. A click is defined as a mousedown and mouseup over the same screen location. The sequence of these events is: * mousedown * mouseup * click | {{Yes}} | {{Yes}} |- | dblclick | ondblclick | Fires when the pointing device button is [[double-click]]ed over an element | {{Yes}} | {{Yes}} |- | mousedown | onmousedown | Fires when the pointing device button is pressed over an element | {{Yes}} | {{Yes}} |- | mouseup | onmouseup | Fires when the pointing device button is released over an element | {{Yes}} | {{Yes}} |- | [[mouseover]] | onmouseover | Fires when the pointing device is moved onto an element | {{Yes}} | {{Yes}} |- | mousemove<ref>{{Cite web|url=https://developer.mozilla.org/en-US/docs/Web/API/Element/mousemove_event|title=Element: Mousemove event - Web APIs | MDN|date=22 December 2023 }}</ref> | onmousemove | Fires when the pointing device is moved while it is over an element | {{Yes}} | {{Yes}} |- | mouseout | onmouseout | Fires when the pointing device is moved away from an element | {{Yes}} | {{Yes}} |- | dragstart | ondragstart | Fired on an element when a drag is started. | {{Yes}} | {{Yes}} |- | drag | ondrag | This event is fired at the source of the drag, that is, the element where dragstart was fired, during the drag operation. | {{Yes}} | {{Yes}} |- | dragenter | ondragenter | Fired when the mouse is first moved over an element while a drag is occurring. | {{Yes}} | {{Yes}} |- | dragleave | ondragleave | This event is fired when the mouse leaves an element while a drag is occurring. | {{Yes}} | {{No}} |- | dragover | ondragover | This event is fired as the mouse is moved over an element when a drag is occurring. | {{Yes}} | {{Yes}} |- | drop | ondrop | The drop event is fired on the element where the drop occurs at the end of the drag operation. | {{Yes}} | {{Yes}} |- | dragend | ondragend | The source of the drag will receive a dragend event when the drag operation is complete, whether it was successful or not. | {{Yes}} | {{No}} |- | rowspan=3 | Keyboard | keydown | onkeydown | Fires before keypress, when a key on the keyboard is pressed. | {{Yes}} | {{Yes}} |- | keypress | onkeypress | Fires after keydown, when a key on the keyboard is pressed. | {{Yes}} | {{Yes}} |- | keyup | onkeyup | Fires when a key on the keyboard is released | {{Yes}} | {{Yes}} |- | rowspan=6 | [[Framing (World Wide Web)|HTML frame]]/object | load | onload | Fires when the [[user agent]] finishes loading all content within a document, including window, frames, objects and images For elements, it fires when the target element and all of its content has finished loading | {{No}} | {{No}} |- | unload | onunload | Fires when the user agent removes all content from a window or frame For elements, it fires when the target element or any of its content has been removed | {{No}} | {{No}} |- | abort | onabort | Fires when an object/image is stopped from loading before completely loaded | {{Yes}} | {{No}} |- | error | onerror | Fires when an object/image/frame cannot be loaded properly | {{Yes}} | {{No}} |- | resize | onresize | Fires when a document view is resized | {{Yes}} | {{No}} |- | scroll | onscroll | Fires when an element or document view is scrolled | {{No}}, except that a scroll event on document must bubble to the window<ref>{{cite web |url=http://www.w3.org/TR/DOM-Level-3-Events/ |title= Document Object Model (DOM) Level 3 Events Specification (working draft) |publisher= [[W3C]] |access-date=2013-04-17}}</ref> | {{No}} |- | rowspan=6 | [[Form (HTML)|HTML form]] | select | onselect | Fires when a user selects some text in a [[Text box|text field]], including input and textarea | {{Yes}} | {{No}} |- | change | onchange | Fires when a control loses the input [[Focus (computing)|focus]] and its value has been modified since gaining focus | {{Yes}} | {{No}} |- | submit | onsubmit | Fires when a form is submitted | {{Yes}} | {{Yes}} |- | reset | onreset | Fires when a form is reset | {{Yes}} | {{No}} |- | focus | onfocus | Fires when an element receives focus either via the pointing device or by [[Tab order|tab navigation]] | {{No}} | {{No}} |- | blur | onblur | Fires when an element loses focus either via the pointing device or by [[tabbing navigation]] | {{No}} | {{No}} |- | rowspan=3 | User interface | focusin | {{CNone|(none)}} | Similar to HTML focus event, but can be applied to any focusable element | {{Yes}} | {{No}} |- | focusout | {{CNone|(none)}} | Similar to HTML blur event, but can be applied to any focusable element | {{Yes}} | {{No}} |- | DOMActivate | {{CNone|(none)}} | Similar to XUL command event. Fires when an element is activated, for instance, through a mouse click or a keypress. | {{Yes}} | {{Yes}} |- | rowspan=7 | Mutation | DOMSubtreeModified | {{CNone|(none)}} | Fires when the subtree is modified | {{Yes}} | {{No}} |- | DOMNodeInserted | {{CNone|(none)}} | Fires when a node has been added as a child of another node | {{Yes}} | {{No}} |- | DOMNodeRemoved | {{CNone|(none)}} | Fires when a node has been removed from a DOM-tree | {{Yes}} | {{No}} |- | DOMNodeRemovedFromDocument | {{CNone|(none)}} | Fires when a node is being removed from a document | {{No}} | {{No}} |- | DOMNodeInsertedIntoDocument | {{CNone|(none)}} | Fires when a node is being inserted into a document | {{No}} | {{No}} |- | DOMAttrModified | {{CNone|(none)}} | Fires when an attribute has been modified | {{Yes}} | {{No}} |- | DOMCharacterDataModified | {{CNone|(none)}} | Fires when the character data has been modified | {{Yes}} | {{No}} |- | rowspan=6 | Progress | loadstart | {{CNone|(none)}} | Progress has begun. | {{No}} | {{No}} |- | progress | {{CNone|(none)}} | In progress. After loadstart has been dispatched. | {{No}} | {{No}} |- | error | {{CNone|(none)}} | Progression failed. After the last progress has been dispatched, or after loadstart has been dispatched if progress has not been dispatched. | {{No}} | {{No}} |- | abort | {{CNone|(none)}} | Progression is terminated. After the last progress has been dispatched, or after loadstart has been dispatched if progress has not been dispatched. | {{No}} | {{No}} |- | load | {{CNone|(none)}} | Progression is successful. After the last progress has been dispatched, or after loadstart has been dispatched if progress has not been dispatched. | {{No}} | {{No}} |- | loadend | {{CNone|(none)}} | Progress has stopped. After one of error, abort, or load has been dispatched. | {{No}} | {{No}} |- |} Note that the events whose names start with "DOM" are currently not well supported, and for this and other performance reasons are deprecated by the W3C in DOM Level 3. [[Mozilla]] and [[Opera (web browser)|Opera]] support ''DOMAttrModified'', ''DOMNodeInserted'', ''DOMNodeRemoved'' and ''DOMCharacterDataModified''. [[Google Chrome|Chrome]] and [[Safari (web browser)|Safari]] support these events, except for ''DOMAttrModified''. ==== Touch events ==== Web browsers running on [[Touchscreen|touch-enabled]] devices, such as Apple's [[IOS (Apple)|iOS]] and Google's [[Android (operating system)|Android]], generate additional events.<ref name="w3c_v2"/>{{rp|Β§5.3}} {| class="wikitable" ! Category ! Type ! Attribute ! Description ! Bubbles ! Cancelable |- | rowspan=6 | Touch | touchstart | | Fires when a finger is placed on the touch surface/screen. | {{Yes}} | {{Yes}} |- | touchend | | Fires when a finger is removed from the touch surface/screen. | {{Yes}} | {{Yes}} |- | touchmove | | Fires when a finger already placed on the screen is moved across the screen. | {{Yes}} | {{Yes}} |- | touchenter | | Fires when a touch point moves onto the interactive area defined by a DOM element. | {{Yes}} | {{Yes}} |- | touchleave | | Fires when a touch point moves off the interactive area defined by a DOM element. | {{Yes}} | {{Yes}} |- | touchcancel | | A [[user agent]] must dispatch this event type to indicate when a TouchPoint has been disrupted in an implementation-specific manner, such as by moving outside the bounds of the UA window. A user agent may also dispatch this event type when the user places more touch points (The coordinate point at which a pointer (e.g. finger or stylus) intersects the target surface of an interface) on the touch surface than the device or implementation is configured to store, in which case the earliest TouchPoint object in the TouchList should be removed.<ref name="w3c_v2"/>{{rp|Β§5.9}} | {{Yes}} | {{No}} |- |} In the [[W3C]] draft recommendation, a <code>TouchEvent</code> delivers a <code>TouchList</code> of <code>Touch</code> locations, the [[modifier key]]s that were active, a <code>TouchList</code> of <code>Touch</code> locations within the targeted DOM element, and a <code>TouchList</code> of <code>Touch</code> locations that have changed since the previous <code>TouchEvent</code>.<ref name="w3c_v2">{{cite web|title=Touch Events version 2 - W3C Editor's Draft|url=http://dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html|publisher=W3C|access-date=10 December 2011|date=14 November 2011}}</ref> [[Apple Inc.|Apple]] didn't join this working group, and delayed W3C recommendation of its Touch Events Specification by disclosing [[software patent|patents]] late in the recommendation process.<ref name="opera">{{cite web|title=Apple using patents to undermine open standards again|url=http://my.opera.com/haavard/blog/2011/12/09/apple-w3c|publisher=opera.com|access-date=9 December 2011|date=9 December 2011}}</ref> ==== Pointer events ==== Web browsers on devices with various types of input devices including mouse, touch panel, and pen may generate integrated input events. Users can see what type of input device is pressed, what button is pressed on that device, and how strongly the button is pressed when it comes to a stylus pen. As of October 2013, this event is only supported by Internet Explorer 10 and 11.<ref>{{cite web|url=http://www.w3.org/TR/2013/CR-pointerevents-20130509/|title=Pointer Events}}</ref> {| class="wikitable" ! Category ! Type ! Attribute ! Description ! Bubbles ! Cancelable |- | rowspan=10 | Pointer | pointerdown | onpointerdown | Fires when the pointing device button is activated, or pressed over an element. | {{Yes}} | {{Yes}} |- | pointerup | onpointerup | Fires when the pointing device button is released over an element | {{Yes}} | {{Yes}} |- | pointercancel | onpointercancel | Fires when a pointing device is unlikely to continue to produce event because, for example, the device is used for panning/zooming after a pointerdown event. | {{Yes}} | {{Yes}} |- | pointermove | onpointermove | Fires when the pointing device is moved while it is over an element | {{Yes}} | {{Yes}} |- | pointerover | onpointerover | Fires when the pointing device is moved onto an element | {{Yes}} | {{Yes}} |- | pointerout | onpointerout | Fires when the pointing device is moved away from an element. Also fires after pointerup by pointing device without hovering, or after | {{Yes}} | {{Yes}} |- | pointerenter | onpointerenter | Fires when the pointing device is moved onto an element, or when the button of the pointing device which does not support hovering is pressed on one of its descendant elements. | {{No}} | {{Yes}} |- | pointerleave | onpointerleave | Fires when the pointing device is moved away from an element, or when the button of the pointing device which does not support hovering is released over its descendant elements. | {{No}} | {{Yes}} |- | gotpointercapture | ongotpointercapture | Fires when the pointer is captured by setPointerCapture method. | {{Yes}} | {{No}} |- | lostpointercapture | onlostpointercapture | Fires when the pointer is released by releasePointerCapture method. | {{Yes}} | {{No}} |- |} ==== Indie UI events ==== Not yet really implemented, the Indie UI working groups want to help web application developers to be able to support standard user interaction events without having to handle different platform specific technical events that could match with it.<ref>{{cite web|url=http://www.w3.org/TR/indie-ui-events/|title=IndieUI: Events 1.0}}</ref> Scripting usable interfaces can be difficult, especially when one considers that user interface design patterns differ across software platforms, hardware, and locales, and that those interactions can be further customized based on personal preference. Individuals are accustomed to the way the interface works on their own system, and their preferred interface frequently differs from that of the web application author's preferred interface. For example, web application authors, wishing to intercept a user's intent to undo the last action, need to "listen" for all the following events: * Control+Z on Windows and Linux. * Command+Z on Mac OS X. * Shake events on some mobile devices. It would be simpler to listen for a single, normalized request to "undo" the previous action. {| class="wikitable" ! Category ! Type ! Description ! Bubbles ! Cancelable |- | rowspan=6 | Request | undorequest | Indicates the user desires to "undo" the previous action. (May be superseded by the UndoManager interface.) | {{Yes}} | {{Yes}} |- | redorequest | Indicates the user desires to "redo" the previously "undone" action. (May be superseded by the UndoManager interface.) | {{Yes}} | {{No}} |- | expandrequest | Indicates the user desires to reveal information in a collapsed section (e.g. a disclosure widget) or branch node in a hierarchy (e.g., a [[tree view]]). | {{Yes}} | {{Yes}} |- | collapserequest | Indicates the user desires to hide or collapse information in an expanded section (e.g. a disclosure widget) or branch node in a hierarchy (e.g., a tree view). | {{Yes}} | {{Yes}} |- | dismissrequest | Indicates the user desires "dismiss" the current view (e.g. canceling a dialog, or closing a popup menu). | {{Yes}} | {{Yes}} |- | deleterequest | Indicates the user wants to initiate a "delete" action on the marked element or current view. | {{Yes}} | {{Yes}} |- | rowspan=4 | Focus Request | directionalfocusrequest | Initiated when the user agent sends a "direction focus" request to the web application. Web authors should not use or register for directionalfocusrequest events when standard browser focus and blur events are sufficient. Using these events unnecessarily could result in reduced performance or negative user experience. | {{Yes}} | {{Yes}} |- | linearfocusrequest | Initiated when the user agent sends a "linear focus" request to the web application. Web authors should not use or register for linearfocusrequest events when standard browser focus and blur events are sufficient. This event type is only necessary on specialized control types such as data grids where the logical next element may not be focusable or even in the DOM until requested. Using these events unnecessarily could result in reduced performance or negative user experience. | {{Yes}} | {{Yes}} |- | palettefocusrequest | Initiated when the user agent sends a "palette focus" request to the web application. Web app authors receiving this event should move focus to the first palette in the web application, or cycle focus between all available palettes. Note: palettes are sometimes referred to as non-modal dialogs or inspector windows. | {{Yes}} | {{Yes}} |- | toolbarfocusrequest | Initiated when the user agent sends a "toolbar focus" request to the web application. Web app authors receiving this event should move focus to the main toolbar in the web application, or cycle focus between all available toolbars. | {{Yes}} | {{Yes}} |- | rowspan=4 | Manipulation Request | moverequest | Initiated when the user agent sends a move request to the web application with accompanying x/y delta values. This is used, for example, when moving an object to a new location on a layout canvas. | {{Yes}} | {{Yes}} |- | panrequest | Initiated when the user agent sends a pan request to the web application with accompanying x/y delta values. This is used, for example, when changing the center point while panning a map or another custom image viewer. | {{Yes}} | {{Yes}} |- | rotationrequest | Initiated when the user agent sends a rotation request to the web application with accompanying origin x/y values and a rotation value in degrees. | {{Yes}} | {{Yes}} |- | zoomrequest | Initiated when the user agent sends a zoom request to the web application with accompanying origin x/y values and the zoom scale factor. | {{Yes}} | {{Yes}} |- | rowspan=1 | Scroll Request | scrollrequest | Initiated when the user agent sends a scroll request to the web application with accompanying x/y delta values or one of the other defined scrollType values. Authors should only use this event and uiaction with custom scroll views. | {{Yes}} | {{Yes}} |- | rowspan=1 | ValueChange Request | valuechangerequest | Initiated when the user agent sends a value change request to the web application. Used on custom range controls like sliders, carousels, etc. | {{Yes}} | {{Yes}} |- |} ==== Internet Explorer-specific events ==== In addition to the common (W3C) events, two major types of events are added by [[Internet Explorer]]. Some of the events have been implemented as [[de facto standard]]s by other browsers. * [[Clipboard (computing)|Clipboard]] events. * Data binding events.{{clarify|date=April 2012}} {| class="wikitable" ! Category ! Type ! Attribute ! Description ! Bubbles ! Cancelable |- | rowspan=6 | Clipboard | cut | oncut | Fires after a selection is cut to the clipboard. | {{Yes}} | {{Yes}} |- | copy | oncopy | Fires after a selection is copied to the clipboard. | {{Yes}} | {{Yes}} |- | paste | onpaste | Fires after a selection is pasted from the clipboard. | {{Yes}} | {{Yes}} |- | beforecut | onbeforecut | Fires before a selection is cut to the clipboard. | {{Yes}} | {{Yes}} |- | beforecopy | onbeforecopy | Fires before a selection is copied to the clipboard. | {{Yes}} | {{Yes}} |- | beforepaste | onbeforepaste | Fires before a selection is pasted from the clipboard. | {{Yes}} | {{Yes}} |- | rowspan=11 | Data binding | afterupdate | onafterupdate | Fires immediately after a databound object has been updated. | {{Yes}} | {{No}} |- | beforeupdate | onbeforeupdate | Fires before a data source is updated. | {{Yes}} | {{Yes}} |- | cellchange | oncellchange | Fires when a data source has changed. | {{Yes}} | {{No}} |- | dataavailable | ondataavailable | Fires when new data from a data source become available. | {{Yes}} | {{No}} |- | datasetchanged | ondatasetchanged | Fires when content at a data source has changed. | {{Yes}} | {{No}} |- | datasetcomplete | ondatasetcomplete | Fires when transfer of data from the data source has completed. | {{Yes}} | {{No}} |- | errorupdate | onerrorupdate | Fires if an error occurs while updating a data field. | {{Yes}} | {{No}} |- | rowenter | onrowenter | Fires when a new row of data from the data source is available. | {{Yes}} | {{No}} |- | rowexit | onrowexit | Fires when a row of data from the data source has just finished. | {{No}} | {{Yes}} |- | rowsdelete | onrowsdelete | Fires when a row of data from the data source is deleted. | {{Yes}} | {{No}} |- | rowinserted | onrowinserted | Fires when a row of data from the data source is inserted. | {{Yes}} | {{No}} |- | rowspan=9 | Mouse | contextmenu | oncontextmenu | Fires when the context menu is shown. | {{Yes}} | {{Yes}} |- | drag | ondrag | Fires when during a [[Drag and drop|mouse drag]] (on the moving Element). | {{Yes}} | {{Yes}} |- | dragstart | ondragstart | Fires when a mouse drag begins (on the moving Element). | {{Yes}} | {{Yes}} |- | dragenter | ondragenter | Fires when something is dragged onto an area (on the target Element). | {{Yes}} | {{Yes}} |- | dragover | ondragover | Fires when a drag is held over an area (on the target Element). | {{Yes}} | {{Yes}} |- | dragleave | ondragleave | Fires when something is dragged out of an area (on the target Element). | {{Yes}} | {{Yes}} |- | dragend | ondragend | Fires when a mouse drag ends (on the moving Element). | {{Yes}} | {{Yes}} |- | drop | ondrop | Fires when a mouse button is released over a valid target during a drag (on the target Element). | {{Yes}} | {{Yes}} |- | selectstart | onselectstart | Fires when the user starts to select text. | {{Yes}} | {{Yes}} |- | Keyboard | help | onhelp | Fires when the user initiates help. | {{Yes}} | {{Yes}} |- | rowspan=2 | HTML frame/object | beforeunload | onbeforeunload | Fires before a document is unloaded. | {{No}} | {{Yes}} |- | stop | onstop | Fires when the user stops loading the object. (unlike abort, stop event can be attached to document) | {{No}} | {{No}} |- | HTML form | beforeeditfocus | onbeforeeditfocus | Fires before an element gains focus for editing. | {{Yes}} | {{Yes}} |- | rowspan=3 | Marquee | start | onstart | Fires when a marquee begins a new loop. | {{No}} | {{No}} |- | finish | onfinish | Fires when marquee looping is complete. | {{No}} | {{Yes}} |- | bounce | onbounce | Fires when a scrolling marquee bounces back in the other direction. | {{No}} | {{Yes}} |- | rowspan=6 | Miscellaneous | beforeprint | onbeforeprint | Fires before a document is printed | {{No}} | {{No}} |- | afterprint | onafterprint | Fires immediately after the document prints. | {{No}} | {{No}} |- | propertychange | onpropertychange | Fires when the property of an object is changed. | {{No}} | {{No}} |- | filterchange | onfilterchange | Fires when a filter changes properties or finishes a transition. | {{No}} | {{No}} |- | readystatechange | onreadystatechange | Fires when the readyState property of an element changes. | {{No}} | {{No}} |- | losecapture | onlosecapture | Fires when the releaseCapture method is invoked. | {{No}} | {{No}} |- |} Note that Mozilla, Safari and Opera also support the readystatechange event for the [[XMLHttpRequest]] object. Mozilla also supports the beforeunload event using the traditional event registration method (DOM Level 0). Mozilla and Safari also support contextmenu, but Internet Explorer for Mac does not. Note that Firefox 6 and later support the beforeprint and afterprint events. === XUL events === In addition to the common (W3C) events, Mozilla defined a set of events that work only with [[XUL]] elements.{{citation needed|date=April 2017}} {| class="wikitable" ! Category ! Type ! Attribute ! Description ! Bubbles ! Cancelable |- | rowspan=6 | Mouse | DOMMouseScroll | DOMMouseScroll | Fires when the mouse wheel is moved, causing the content to scroll. | {{Yes}} | {{Yes}} |- | dragdrop | ondragdrop | Fires when the user releases the mouse button to [[Drag and drop|drop an object being dragged]]. | {{No}} | {{No}} |- | dragenter | ondragenter | Fires when the mouse pointer first moves over an element during a drag. It is similar to the mouseover event but occurs while dragging. | {{No}} | {{No}} |- | dragexit | ondragexit | Fires when the mouse pointer moves away from an element during a drag. It is also called after a drop on an element. It is similar to the mouseout event but occurs during a drag. | {{No}} | {{No}} |- | draggesture | ondraggesture | Fires when the user starts dragging the element, usually by holding down the mouse button and moving the mouse. | {{No}} | {{No}} |- | dragover | ondragover | Related to the mousemove event, this event is fired while something is being dragged over an element. | {{No}} | {{No}} |- | rowspan=5 | Input | CheckboxStateChange | | Fires when a checkbox is checked or unchecked, either by the user or a script. | {{No}} | {{No}} |- | RadioStateChange | | Fires when a radio button is selected, either by the user or a script. | {{No}} | {{No}} |- | close | onclose | Fires when a request has been made to close the window. | {{No}} | {{Yes}} |- | command | oncommand | Similar to W3C DOMActivate event. Fires when an element is activated, for instance, through a mouse click or a keypress. | {{No}} | {{No}} |- | input | oninput | Fires when a user enters text in a textbox. | {{Yes}} | {{No}} |- | rowspan=10 | User interface | DOMMenuItemActive | DOMMenuItemActive | Fires when a menu or menuitem is [[Mouseover|hovered over]], or highlighted. | {{Yes}} | {{No}} |- | DOMMenuItemInactive | DOMMenuItemInactive | Fires when a menu or menuitem is no longer being hovered over, or highlighted. | {{Yes}} | {{No}} |- | contextmenu | oncontextmenu | Fires when the user requests to open the context menu for the element. The action to do this varies by platform, but it will typically be a right click. | {{No}} | {{Yes}} |- | overflow | onoverflow | Fires a box or other layout element when there is not enough space to display it at full size. | {{No}} | {{No}} |- | overflowchanged | onoverflowchanged | Fires when the overflow state changes. | {{No}} | {{No}} |- | underflow | onunderflow | Fires to an element when there becomes enough space to display it at full size. | {{No}} | {{No}} |- | popuphidden | onpopuphidden | Fires to a popup after it has been hidden. | {{No}} | {{No}} |- | popuphiding | onpopuphiding | Fires to a popup when it is about to be hidden. | {{No}} | {{No}} |- | popupshowing | onpopupshowing | Fires to a popup just before it is popped open. | {{No}} | {{Yes}} |- | popupshown | onpopupshown | Fires to a popup after it has been opened, much like the onload event is sent to a window when it is opened. | {{No}} | {{No}} |- | rowspan=2 | Command | broadcast | onbroadcast | Placed on an observer. The broadcast event is sent when the attributes of the broadcaster being listened to are changed. | {{No}} | {{No}} |- | commandupdate | oncommandupdate | Fires when a command update occurs. | {{No}} | {{No}} |- |} === Other events === For Mozilla and Opera 9, there are also undocumented events known as ''DOMContentLoaded'' and ''DOMFrameContentLoaded'' which fire when the DOM content is loaded. These are different from "load" as they fire before the loading of related files (e.g., images). However, DOMContentLoaded has been added to the [[HTML 5]] specification.<ref>{{Cite web|url=https://www.w3.org/TR/html5/|title = HTML Standard}}</ref> The DOMContentLoaded event was also implemented in the [[Webkit]] rendering engine build 500+.<ref>[http://perfectionlabstips.wordpress.com/2008/12/01/which-browsers-support-native-domcontentloaded-event/] {{webarchive |url=https://web.archive.org/web/20100611124414/http://perfectionlabstips.wordpress.com/2008/12/01/which-browsers-support-native-domcontentloaded-event/ |date=June 11, 2010 }}</ref><ref>{{cite web|url=http://perfectionlabstips.wordpress.com/2008/12/01/which-browsers-support-native-domcontentloaded-event/ |title=Which browsers support native DOMContentLoaded event? Β« Perfection Labs Development Tips |date=29 June 2011 |url-status=bot: unknown |archive-url=https://web.archive.org/web/20110629162544/http://perfectionlabstips.wordpress.com/2008/12/01/which-browsers-support-native-domcontentloaded-event/ |archive-date=29 June 2011 }}</ref> This correlates to all versions of [[Google Chrome]] and [[Safari (web browser)|Safari]] 3.1+. DOMContentLoaded is also implemented in [[IE 9|Internet Explorer 9]].<ref>{{cite web|url=http://ie.microsoft.com/testdrive/HTML5/87DOMContent-Loaded/Default.html|title=Test Drive Redirect|access-date=2010-05-06|archive-url=https://web.archive.org/web/20100508033345/http://ie.microsoft.com/testdrive/HTML5/87DOMContent-Loaded/Default.html|archive-date=2010-05-08|url-status=dead}}</ref> Opera 9 also supports the Web Forms 2.0 events ''DOMControlValueChanged'', ''invalid'', ''forminput'' and ''formchange''.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)