JavaScript in the Browser

Events

Category Type Attribute Description Bubbles Cancelable
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 clicked 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 button is moved onto an element. Yes Yes
mousemove onmousemove Fires when the pointing device button is moved while it is over an element. Yes No
mouseout onmouseout Fires when the pointing device button is moved away from an element. Yes Yes
Keyboard keypress onkeypress Fires when a key on the keyboard is "clicked". A keypress is defined as a keydown and keyup on the same key. The sequence of these events is:
  • keydown
  • keyup
  • keypress
Yes Yes
keydown onkeydown Fires when a key on the keyboard is pressed. Yes Yes
keyup onkeyup Fires when a key on the keyboard is released. Yes Yes
HTML frame/object load onload Fires when finishes loading all content within a document, including window, frame, object and image. No No
unload onunload Fires when removes all content from a window or frame. No No
abort onabort Fires when an object/image loading is stopped 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 a document view is scrolled. Yes No
HTML form select onselect Fires when a user selects some text in a text field, including input and textarea. Yes No
change onchange Fires when a control loses the input focus and its value has been modified since gaining focus, including input, select and textarea. 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 tabbing navigation, including label, input, select, textarea, and button. No No
blur onblur Fires when an element loses focus either via the pointing device or by tabbing navigation, including label, input, select, textarea, and button. No No
User interface DOMFocusIn ondomfocusin Similar to HTML focus event, but can be applied to any focusable element. Yes No
DOMFocusOut ondomfocusout Similar to HTML blur event, but can be applied to any focusable element. Yes No
DOMActivate ondomactivate Similar to XUL command event. Fires when an element is activated, for instance, through a mouse click or a keypress. Yes Yes
Mutation DOMSubtreeModified onsubtreemodified Fire when the subtree is modified. Yes No
DOMNodeInserted onnodeinserted Fires when a node has been added as a child of another node. Yes No
NodeInsertedIntoDocument onnodeinsertedintodocument Fires when a node is being inserted into a document. No No
DOMAttrModified onattrmodified Fires when an attribute has been modified. Yes No
DOMCharacterDataModified oncharacterdatamodified Fires when the character data has been modified. Yes No

José M. Vidal .

42 of 66