After scouring the Internet for any useful DHTML/DOM events I could find, I have finally compiled what hopefully is a complete list of current javascript events. More of a reference than anything else, I've listed each event with some links providing more information and specification.
Please take note that many of these events are only supported in either IE or Mozilla and not both -- however one good indicator of cross browser support is whether or not the event is a W3C standard. Keep in mind that one browser may implement a particular event differently from the next browser.
First, some good general resources:
| W3C | Event | Description | More Information |
|---|---|---|---|
| Yes | onabort | Fires when the user aborts the download of an image. | W3C MSDN Wiki |
| No | onactivate | Fires when the object is set as the active element. | MSDN |
| No | onafterprint | Fires on the object immediately after its associated document prints or previews for printing. | MSDN Wiki |
| No | onafterupdate | Fires on a databound object after successfully updating the associated data in the data source object. | MSDN Wiki |
| No | onattrmodified | Fires when an attribute has been modified | MDC Wiki |
| No | onbeforeactivate | Fires immediately before the object is set as the active element. | MSDN |
| No | onbeforecopy | Fires on the source object before the selection is copied to the system clipboard. | MSDN Wiki |
| No | onbeforecut | Fires on the source object before the selection is deleted from the document. | MSDN Wiki |
| No | onbeforedeactivate | Fires immediately before the activeElement is changed from the current object to another object in the parent document. | MSDN |
| No | onbeforeeditfocus | Fires before an object contained in an editable element enters a UI-activated state or when an editable container object is control selected. | MSDN Wiki |
| No | onbeforepaste | Fires on the target object before the selection is pasted from the system clipboard to the document. | MSDN Wiki |
| No | onbeforeprint | Fires on the object before its associated document prints or previews for printing. | MSDN Wiki |
| No | onbeforeunload | Fires prior to a page being unloaded. | MSDN Wiki |
| No | onbeforeupdate | Fires on a databound object before updating the associated data in the data source object. | MSDN Wiki |
| Yes | onblur | Fires when the object loses the input focus. | W3C MDC MSDN Wiki |
| No | onbounce | Fires when the behavior property of the marquee object is set to "alternate" and the contents of the marquee reach one side of the window. | MSDN Wiki |
| No | onbroadcast | The event handler should be placed on an observer. The broadcast event is sent when the attributes of the element (such as a broadcaster) being listened to are changed. | MDC Wiki |
| No | oncellchange | Fires when data changes in the data provider. | MSDN Wiki |
| Yes | onchange | Fires when the contents of the object or selection have changed. | W3C MDC MSDN Wiki |
| No | oncharacterdatamodified | Fires when the character data has been modified | Wiki |
| Yes | onclick | Fires when the user clicks the left mouse button on the object. | W3C MDC MSDN Wiki |
| No | onclose | This event is sent when a request has been made to close the window when the user presses the close button. If you place an event handler on the window element, you can trap the window close. If you return false from the close handler, the window will not close. Return true to have it close normally. Note that this event is only fired when the user presses the close button on the titlebar; use the unload event to capture all attempts to unload the window. | MDC Wiki |
| No | oncommand | This event handler is called when an element is activated. How it is activated varies for each element and in many cases, there are several ways to activate an element. For example, a button can be activated by clicking on it with the mouse or by pressing ENTER while it has the focus. Menus can be activated by selecting them with the mouse or by pressing a shortcut key. You should always use the command event instead of click because it will be called in all of the needed cases. | MDC Wiki |
| No | oncommandupdate | This event occurs when a command update occurs on a |
MDC Wiki |
| No | oncontextmenu | This event is sent to an element 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. This handler is usually used to dynamically set the commands on a menu when the user requests to display it, or you can use popupshowing event. Returning false from this event handler prevents the popup from appearing. | MDC MSDN Wiki |
| No | oncontrolselect | Fires when the user is about to make a control selection of the object. | MSDN |
| No | oncopy | Fires on the source element when the user copies the object or selection, adding it to the system clipboard. | MSDN Wiki |
| No | oncut | Fires on the source element when the object or selection is removed from the document and added to the system clipboard. | MSDN Wiki |
| No | ondataavailable | Fires periodically as data arrives from data source objects that asynchronously transmit their data. | MSDN Wiki |
| No | ondatasetchanged | Fires when the data set exposed by a data source object changes. | MSDN Wiki |
| No | ondatasetcomplete | Fires to indicate that all data is available from the data source object. | MSDN Wiki |
| Yes | ondblclick | Fires when the user double-clicks the object. | W3C MDC MSDN Wiki |
| No | ondeactivate | Fires when the activeElement is changed from the current object to another object in the parent document. | MSDN |
| No | ondomactivate | Similar to the oncommand event. Fires when an element is activated, for instance, through a mouse click or a keypress. | Wiki |
| No | ondomfocusin | Similar to HTML focus event, but can be applied to any focusable element | Wiki |
| No | ondomfocusout | Similar to HTML blur event, but can be applied to any focusable element | Wiki |
| No | ondomnodeinsertedintodocument | Fires when a node is being inserted into a document | Wiki |
| No | ondomnoderemovedfromdocument | Fires when a node is being removed from a document | Wiki |
| No | ondrag | Fires on the source object continuously during a drag operation. | MDC MSDN Wiki |
| No | ondragdrop | This event is sent when the user releases the mouse button to drop an object being dragged. The element, if it accepts the drop, should respond in some manner such inserting the dragged object into itself. | MDC Wiki |
| No | ondragend | Fires on the source object when the user releases the mouse at the close of a drag operation. | MDC MSDN Wiki |
| No | ondragenter | Fires on the target element when the user drags the object to a valid drop target. | MDC MSDN Wiki |
| No | ondragexit | This event is sent 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. | MDC Wiki |
| No | ondraggesture | This event is sent when the user starts dragging the element, usually by holding down the mouse button and moving the mouse. | MDC Wiki |
| No | ondragleave | Fires on the target object when the user moves the mouse out of a valid drop target during a drag operation. | MSDN Wiki |
| No | ondragover | Fires on the target element continuously while the user drags the object over a valid drop target. | MDC MSDN Wiki |
| No | ondragstart | Fires on the source object when the user starts to drag a text selection or selected object. | MSDN Wiki |
| No | ondrop | Fires on the target object when the mouse button is released during a drag-and-drop operation. | MSDN Wiki |
| Yes | onerror | Fires when an error occurs during object loading. | W3C MSDN Wiki |
| No | onerrorupdate | Fires on a databound object when an error occurs while updating the associated data in the data source object. | MSDN Wiki |
| No | onfilterchange | Fires when a visual filter changes state or completes a transition. | MSDN Wiki |
| No | onfinish | Fires when marquee looping is complete. | MSDN Wiki |
| Yes | onfocus | Fires when the object receives focus. | W3C MDC MSDN Wiki |
| No | onfocusin | Fires for an element just prior to setting focus on that element. | MSDN |
| No | onfocusout | Fires for the current element with focus immediately after moving focus to another element. | MSDN |
| No | onhelp | Fires when the user presses the F1 key while the browser is the active window. | MSDN Wiki |
| No | oninput | This event is sent when a user enters text in a textbox. This event is only called when the text displayed would change, thus it is not called when the user presses non-displayable keys. | MDC Wiki |
| Yes | onkeydown | Fires when the user presses a key. | W3C MDC MSDN Wiki |
| Yes | onkeypress | Fires when the user presses an alphanumeric key. | W3C MDC MSDN Wiki |
| Yes | onkeyup | Fires when the user releases a key. | W3C MDC MSDN Wiki |
| No | onlayoutcomplete | Fires when the print or print preview layout process finishes filling the current LayoutRect object with content from the source document. | MSDN |
| Yes | onload | Fires immediately after the browser loads the object. | W3C MDC MSDN Wiki |
| No | onlosecapture | Fires when the object loses the mouse capture. | MSDN Wiki |
| Yes | onmousedown | Fires when the user clicks the object with either mouse button. | W3C MDC MSDN Wiki |
| No | onmouseenter | Fires when the user moves the mouse pointer into the object. | MSDN |
| No | onmouseleave | Fires when the user moves the mouse pointer outside the boundaries of the object. | MSDN |
| Yes | onmousemove | Fires when the user moves the mouse over the object. | W3C MDC MSDN Wiki |
| Yes | onmouseout | Fires when the user moves the mouse pointer outside the boundaries of the object. | W3C MDC MSDN Wiki |
| Yes | onmouseover | Fires when the user moves the mouse pointer into the object. | W3C MDC MSDN Wiki |
| Yes | onmouseup | Fires when the user releases a mouse button while the mouse is over the object. | W3C MDC MSDN Wiki |
| No | onmousewheel | Fires when the wheel button is rotated. | MSDN |
| No | onmove | Fires when the object moves. | MSDN |
| No | onmoveend | Fires when the object stops moving. | MSDN |
| No | onmovestart | Fires when the object starts to move. | MSDN |
| No | onnodeinserted | Fires when a node has been added as a child of another node | Wiki |
| No | onnoderemoved | Fires when a node has been removed from a DOM-tree | Wiki |
| No | onoverflow | This event is only sent to a box or other layout element with a CSS overflow property set to a value other than 'visible'. When there is not enough space to display the contents of the element at full size, the overflow event will be fired. Depending on the value of the overflow property, scrollbars may have appeared. For example, if a box has a maximum size of 100 pixels, and only enough space for 80 pixels is available, the overflow event will be sent to the box. If the size changes, for example, by the user resizing the window, the underflow event will be fired when enough space becomes available. | MDC Wiki |
| No | onoverflowchanged | This element is called when an element's overflow state changes. This can indicate that it did not have enough space to display it contents fully but does now, or that it does not have enough space and thus overflowed. | Wiki |
| No | onpaste | Fires on the target object when the user pastes data, transferring the data from the system clipboard to the document. | MSDN Wiki |
| No | onpopuphidden | This event is sent to a popup after it has been hidden. | MDC Wiki |
| No | onpopuphiding | This event is sent to a popup when it is about to be hidden. | MDC Wiki |
| No | onpopupshowing | This event is sent to a popup just before it is popped open. This handler is usually used to dynamically set the contents when the user requests to display it. Returning false from this event handler prevents the popup from appearing. | MDC Wiki |
| No | onpopupshown | This is event is sent to a popup after it has been opened, much like the onload event is sent to a window when it is opened. | MDC Wiki |
| No | onpropertychange | Fires when a property changes on the object. | MSDN Wiki |
| No | onreadystatechange | Fires when the state of the object has changed. | MSDN Wiki |
| Yes | onreset | Fires when the user resets a form. | W3C MSDN Wiki |
| Yes | onresize | Fires when the size of the object is about to change. | W3C MSDN Wiki |
| No | onresizeend | Fires when the user finishes changing the dimensions of the object in a control selection. | MSDN |
| No | onresizestart | Fires when the user begins to change the dimensions of the object in a control selection. | MSDN |
| No | onrowenter | Fires to indicate that the current row has changed in the data source and new data values are available on the object. | MSDN Wiki |
| No | onrowexit | Fires just before the data source control changes the current row in the object. | MSDN Wiki |
| No | onrowsdelete | Fires when rows are about to be deleted from the recordset. | MSDN Wiki |
| No | onrowsinserted | Fires just after new rows are inserted in the current recordset. | MSDN |
| No | onscroll | Fires when the user repositions the scroll box in the scroll bar on the object. | MSDN Wiki |
| Yes | onselect | Fires when the current selection changes. | W3C MDC MSDN Wiki |
| No | onselectionchange | Fires when the selection state of a document changes. | MSDN |
| No | onselectstart | Fires when the object is being selected. | MSDN Wiki |
| No | onstart | Fires at the beginning of every loop of the marquee object. | MSDN Wiki |
| No | onstop | Fires when the user clicks the Stop button or leaves the Web page. | MSDN Wiki |
| Yes | onsubmit | Fires when a FORM is about to be submitted. | W3C MSDN Wiki |
| No | onsubtreemodified | Fires when the subtree is modified. | Wiki |
| No | onunderflow | This event is sent to an element when there becomes enough space to display it at full size. This applies to boxes and other layout elements with a CSS overflow property other than 'visible'. The underflow event can be used to indicate that a scrolling mechanism is no longer necessary. | MDC Wiki |
| Yes | onunload | Fires immediately before the object is unloaded. | W3C MDC MSDN Wiki |
Comments