Event reference

Sự kiện DOM được gửi để thông báo những điều thú vị đã diễn ra trong code. Mỗi sự kiện được đại diện bởi một đối tượng dựa trên interface Event (en-US), và có thể có các trường và / hoặc chức năng tùy chỉnh bổ sung được sử dụng để có thêm thông tin về những gì đã xảy ra. Sự kiện có thể đại diện cho mọi thứ, từ tương tác người dùng cơ bản đến thông báo tự động về những điều xảy ra trong mô hình kết xuất.

Bài viết này cung cấp một danh sách các sự kiện có thể được gửi; một số là sự kiện tiêu chuẩn được định nghĩa trong những đặc điểm chính thức, trong khi những sự kiện khác được sử dụng dành riêng cho một số trình duyệt ; ví dụ, Các sự kiện dành riêng cho Mozilla được liệt kê để các tiện ích bổ sung (add-on) có thể sử dụng chúng để tương tác với trình duyệt.

Danh mục phổ biến nhất

Sự kiện tài nguyên

Tên sự kiện Bắt đầu khi
cached Các tài nguyên được liệt kê trong tệp kê khai đã được tải xuống và ứng dụng hiện được lưu trữ.
error (en-US) Một tài nguyên không thể tải được.
abort (en-US)

Việc tải tài nguyên đã bị hủy bỏ

load (en-US) Một tài nguyên và tài nguyên phụ thuộc của nó đã được tải xong..
beforeunload (en-US) Cửa sổ, tài liệu và tài nguyên của nó sắp được dỡ bỏ.
unload (en-US) Tài liệu hoặc tài nguyên phụ thuộc đang được dỡ bỏ.

Sự kiện mạng

Tên sự kiện Bắt đầu khi
online (en-US) Trình duyệt đã giành được quyền truy cập vào mạng
offline (en-US) Trình duyệt đã mất quyền truy cập vào mạng

Focus events

Event Name Fired When
focus (en-US) An element has received focus (does not bubble).
blur (en-US) An element has lost focus (does not bubble).

WebSocket events

Event Name Fired When
open A WebSocket connection has been established.
message A message is received through a WebSocket.
error (en-US) A WebSocket connection has been closed with prejudice (some data couldn't be sent for example).
close A WebSocket connection has been closed.

Session History events

Event Name Fired When
pagehide (en-US) A session history entry is being traversed from.
pageshow (en-US) A session history entry is being traversed to.
popstate (en-US) A session history entry is being navigated to (in certain cases).

CSS Animation events

Event Name Fired When
animationstart (en-US) A CSS animation has started.
animationend (en-US) A CSS animation has completed.
animationiteration (en-US) A CSS animation is repeated.

CSS Transition events

Event Name Fired When
transitionstart A CSS transition has actually started (fired after any delay).
transitioncancel A CSS transition has been cancelled.
transitionend (en-US) A CSS transition has completed.
transitionrun A CSS transition has begun running (fired before any delay starts).

Form events

Event Name Fired When
reset (en-US) The reset button is pressed
submit (en-US) The submit button is pressed

Printing events

Event Name Fired When
beforeprint (en-US) The print dialog is opened
afterprint (en-US) The print dialog is closed

Text Composition events

Event Name Fired When
compositionstart (en-US) The composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
compositionupdate (en-US) A character is added to a passage of text being composed.
compositionend (en-US) The composition of a passage of text has been completed or canceled.

View events

Event Name Fired When
fullscreenchange (en-US) An element was turned to fullscreen mode or back to normal mode.
fullscreenerror (en-US) It was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.
resize (en-US) The document view has been resized.
scroll (en-US) The document view or an element has been scrolled.

Clipboard events

Event Name Fired When
cut (en-US) The selection has been cut and copied to the clipboard
copy (en-US) The selection has been copied to the clipboard
paste (en-US) The item from the clipboard has been pasted

Keyboard events

Event Name Fired When
keydown (en-US) ANY key is pressed
keypress (en-US) ANY key except Shift, Fn, CapsLock is in pressed position. (Fired continously.)
keyup (en-US) ANY key is released

Mouse events

Event Name Fired When
auxclick A pointing device button (ANY non-primary button) has been pressed and released on an element.
click (en-US) A pointing device button (ANY button; soon to be primary button only) has been pressed and released on an element.
contextmenu (en-US) The right button of the mouse is clicked (before the context menu is displayed).
dblclick (en-US) A pointing device button is clicked twice on an element.
mousedown (en-US) A pointing device button is pressed on an element.
mouseenter (en-US) A pointing device is moved onto the element that has the listener attached.
mouseleave (en-US) A pointing device is moved off the element that has the listener attached.
mousemove (en-US) A pointing device is moved over an element. (Fired continously as the mouse moves.)
mouseover (en-US) A pointing device is moved onto the element that has the listener attached or onto one of its children.
mouseout (en-US) A pointing device is moved off the element that has the listener attached or off one of its children.
mouseup (en-US) A pointing device button is released over an element.
pointerlockchange (en-US) The pointer was locked or released.
pointerlockerror (en-US) It was impossible to lock the pointer for technical reasons or because the permission was denied.
select (en-US) Some text is being selected.
wheel (en-US) A wheel button of a pointing device is rotated in any direction.

Drag & Drop events

Event Name Fired When
drag (en-US) An element or text selection is being dragged (Fired continuously every 350ms).
dragend (en-US) A drag operation is being ended (by releasing a mouse button or hitting the escape key).
dragenter (en-US) A dragged element or text selection enters a valid drop target.
dragstart (en-US) The user starts dragging an element or text selection.
dragleave (en-US) A dragged element or text selection leaves a valid drop target.
dragover (en-US) An element or text selection is being dragged over a valid drop target. (Fired continuously every 350ms.)
drop (en-US) An element is dropped on a valid drop target.

Media events

Event Name Fired When
audioprocess (en-US) The input buffer of a ScriptProcessorNode (en-US) is ready to be processed.
canplay (en-US) The browser can play the media, but estimates that not enough data has been loaded to play the media up to its end without having to stop for further buffering of content.
canplaythrough (en-US) The browser estimates it can play the media up to its end without stopping for content buffering.
complete (en-US) The rendering of an OfflineAudioContext (en-US) is terminated.
durationchange (en-US) The duration attribute has been updated.
emptied (en-US) The media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
ended (en-US) Playback has stopped because the end of the media was reached.
loadeddata (en-US) The first frame of the media has finished loading.
loadedmetadata (en-US) The metadata has been loaded.
pause (en-US) Playback has been paused.
play (en-US) Playback has begun.
playing (en-US) Playback is ready to start after having been paused or delayed due to lack of data.
ratechange (en-US) The playback rate has changed.
seeked (en-US) A seek operation completed.
seeking (en-US) A seek operation began.
stalled (en-US) The user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
suspend (en-US) Media data loading has been suspended.
timeupdate (en-US) The time indicated by the currentTime attribute has been updated.
volumechange (en-US) The volume has changed.
waiting (en-US) Playback has stopped because of a temporary lack of data.

Progress events

Event Name Fired When
abort Progression has been terminated (not due to an error).
error (en-US) Progression has failed.
load Progression has been successful.
loadend (en-US) Progress has stopped (after "error", "abort" or "load" have been dispatched).
loadstart (en-US) Progress has begun.
progress (en-US) In progress.
timeout Progression is terminated due to preset time expiring.

Storage events

change (en-US) (see Non-standard events)
storage (en-US)

Update events

checking
downloading
error (en-US)
noupdate
obsolete
updateready

Value change events

broadcast
CheckboxStateChange
hashchange (en-US)
input (en-US)
RadioStateChange
readystatechange (en-US)
ValueChange

Uncategorized events

invalid (en-US)
localized
message
message
message
open
show (en-US)

Less common and non-standard events

Abortable Fetch events

Event name Fired when
abort A DOM request is aborted, i.e. using AbortController.abort() (en-US).

WebVR events

Event name Fired when
vrdisplayactivate When a VR display is able to be presented to, for example if an HMD has been moved to bring it out of standby, or woken up by being put on.
vrdisplayblur when presentation to a VRDisplay (en-US) has been paused for some reason by the browser, OS, or VR hardware — for example, while the user is interacting with a system menu or browser, to prevent tracking or loss of experience.
vrdisplayconnect when a compatible VRDisplay (en-US) is connected to the computer.
vrdisplaydeactivate When a VRDisplay (en-US) can no longer be presented to, for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
vrdisplaydisconnect When a compatible VRDisplay (en-US) is disconnected from the computer.
vrdisplayfocus When presentation to a VRDisplay (en-US) has resumed after being blurred.
vrdisplaypresentchange The presenting state of a VRDisplay (en-US) changes — i.e. goes from presenting to not presenting, or vice versa.

SVG events

SVGAbort (en-US)
SVGError (en-US)
SVGLoad (en-US)
SVGResize (en-US)
SVGScroll (en-US)
SVGUnload (en-US)
SVGZoom

Database events

abort
blocked
complete
error (en-US) (link)
success
upgradeneeded
versionchange

Notification events

AlertActive
AlertClose

CSS events

Script events

afterscriptexecute (en-US)
beforescriptexecute (en-US)

DOMMenuItemActive
DOMMenuItemInactive

Window events

Document events

DOMLinkAdded
DOMLinkRemoved
DOMMetaAdded
DOMMetaRemoved
DOMModalDialogClosed
DOMWillOpenModalDialog

popuphidden
popuphiding
popupshowing
popupshown
DOMPopupBlocked

Tab events

Battery events

chargingchange
chargingtimechange
dischargingtimechange
levelchange

Call events

alerting
busy
callschanged
cfstatechange
connected
connecting
dialing
disconnected
disconnecting
error
held, holding
incoming
resuming
statechange (en-US)
voicechange

Sensor events

compassneedscalibration
devicelight
devicemotion (en-US)
deviceorientation (en-US)
deviceproximity
MozOrientation
orientationchange (en-US)
userproximity

Smartcard events

icccardlockerror
iccinfochange
smartcard-insert
smartcard-remove
stkcommand
stksessionend
cardstatechange

SMS and USSD events

delivered
received
sent
ussdreceived

Frame events

mozbrowserclose
mozbrowsercontextmenu
mozbrowsererror
mozbrowsericonchange
mozbrowserlocationchange
mozbrowserloadend
mozbrowserloadstart
mozbrowseropenwindow
mozbrowsersecuritychange
mozbrowsershowmodalprompt (link)
mozbrowsertitlechange
DOMFrameContentLoaded

DOM mutation events

DOMAttributeNameChanged
DOMAttrModified
DOMCharacterDataModified
DOMContentLoaded (en-US)
DOMElementNameChanged
DOMNodeInserted
DOMNodeInsertedIntoDocument
DOMNodeRemoved
DOMNodeRemovedFromDocument
DOMSubtreeModified

Touch events

MozEdgeUIGesture
MozMagnifyGesture
MozMagnifyGestureStart
MozMagnifyGestureUpdate
MozPressTapGesture
MozRotateGesture
MozRotateGestureStart
MozRotateGestureUpdate
MozSwipeGesture
MozTapGesture
MozTouchDown
MozTouchMove
MozTouchUp
touchcancel (en-US)
touchend (en-US)
touchenter
touchleave
touchmove (en-US)
touchstart (en-US)

Pointer events

pointerover
pointerenter
pointerdown
pointermove
pointerup
pointercancel
pointerout
pointerleave
gotpointercapture
lostpointercapture

Standard events

These events are defined in official Web specifications, and should be common across browsers. Each event is listed along with the interface representing the object sent to recipients of the event (so you can find information about what data is provided with each event) as well as a link to the specification or specifications that define the event.

Event Name Event Type Specification Fired when...
abort (en-US) UIEvent (en-US) DOM L3 The loading of a resource has been aborted.
abort ProgressEvent (en-US) Progress and XMLHttpRequest Progression has been terminated (not due to an error).
abort Event (en-US) IndexedDB A transaction has been aborted.
afterprint (en-US) Event (en-US) HTML5 The associated document has started printing or the print preview has been closed.
animationend (en-US) AnimationEvent (en-US) This is an experimental API that should not be used in production code. CSS Animations A CSS animation has completed.
animationiteration (en-US) AnimationEvent (en-US) This is an experimental API that should not be used in production code. CSS Animations A CSS animation is repeated.
animationstart (en-US) AnimationEvent (en-US) This is an experimental API that should not be used in production code. CSS Animations A CSS animation has started.
appinstalled Event (en-US) Web App Manifest A web application is successfully installed as a progressive web app.
audioprocess (en-US) AudioProcessingEvent (en-US) This deprecated API should no longer be used, but will probably still work. Web Audio API
The definition of 'audioprocess' in that specification.
The input buffer of a ScriptProcessorNode (en-US) is ready to be processed.
audioend This is an experimental API that should not be used in production code. Event (en-US) Web Speech API The user agent has finished capturing audio for speech recognition.
audiostart This is an experimental API that should not be used in production code. Event (en-US) Web Speech API The user agent has started to capture audio for speech recognition.
beforeprint (en-US) Event (en-US) HTML5 The associated document is about to be printed or previewed for printing.
beforeunload (en-US) BeforeUnloadEvent (en-US) HTML5 The window, the document and its resources are about to be unloaded.
beginEvent (en-US) TimeEvent (en-US) SVG A SMIL animation element begins.
blocked IndexedDB An open connection to a database is blocking a versionchange transaction on the same database.
blur (en-US) FocusEvent (en-US) This is an experimental API that should not be used in production code. DOM L3 An element has lost focus (does not bubble).
boundary This is an experimental API that should not be used in production code. SpeechSynthesisEvent (en-US) Web Speech API The spoken utterance reaches a word or sentence boundary
cached Event (en-US) Offline The resources listed in the manifest have been downloaded, and the application is now cached.
canplay (en-US) Event (en-US) HTML5 media 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 having to stop for further buffering of content.
canplaythrough (en-US) Event (en-US) HTML5 media The user agent can play the media up to its end without having to stop for further buffering of content.
change (en-US) Event (en-US) DOM L2, HTML5 The change event is fired for <input> (en-US), <select> (en-US), and <textarea> (en-US) elements when a change to the element's value is committed by the user.
chargingchange Event (en-US) Battery status The battery begins or stops charging.
chargingtimechange Event (en-US) Battery status The chargingTime attribute has been updated.
checking Event (en-US) Offline The user agent is checking for an update, or attempting to download the cache manifest for the first time.
click (en-US) MouseEvent (en-US) DOM L3 A pointing device button has been pressed and released on an element.
close Event (en-US) WebSocket A WebSocket connection has been closed.
complete IndexedDB A transaction successfully completed.
complete (en-US) OfflineAudioCompletionEvent (en-US) This deprecated API should no longer be used, but will probably still work. Web Audio API
The definition of 'OfflineAudioCompletionEvent' in that specification.
The rendering of an OfflineAudioContext (en-US) is terminated.
compositionend (en-US) CompositionEvent (en-US) DOM L3 The composition of a passage of text has been completed or canceled.
compositionstart (en-US) CompositionEvent (en-US) DOM L3 The composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
compositionupdate (en-US) CompositionEvent (en-US) DOM L3 A character is added to a passage of text being composed.
contextmenu (en-US) MouseEvent (en-US) HTML5 The right button of the mouse is clicked (before the context menu is displayed).
copy (en-US) ClipboardEvent (en-US) This is an experimental API that should not be used in production code. Clipboard The text selection has been added to the clipboard.
cut (en-US) ClipboardEvent (en-US) This is an experimental API that should not be used in production code. Clipboard The text selection has been removed from the document and added to the clipboard.
dblclick (en-US) MouseEvent (en-US) DOM L3 A pointing device button is clicked twice on an element.
devicechange Event (en-US) Media Capture and Streams A media device such as a camera, microphone, or speaker is connected or removed from the system.
devicelight DeviceLightEvent (en-US) This is an experimental API that should not be used in production code. Ambient Light Events Fresh data is available from a light sensor.
devicemotion (en-US) DeviceMotionEvent (en-US) This is an experimental API that should not be used in production code. Device Orientation Events Fresh data is available from a motion sensor.
deviceorientation (en-US) DeviceOrientationEvent (en-US) This is an experimental API that should not be used in production code. Device Orientation Events Fresh data is available from an orientation sensor.
deviceproximity DeviceProximityEvent (en-US) This is an experimental API that should not be used in production code. Proximity Events Fresh data is available from a proximity sensor (indicates an approximated distance between the device and a nearby object).
dischargingtimechange Event (en-US) Battery status The dischargingTime attribute has been updated.
DOMActivate This deprecated API should no longer be used, but will probably still work. UIEvent (en-US) DOM L3 A button, link or state changing element is activated (use click (en-US) instead).
DOMAttributeNameChanged This deprecated API should no longer be used, but will probably still work. MutationNameEvent DOM L3 Removed The name of an attribute changed (use mutation observers instead).
DOMAttrModified This deprecated API should no longer be used, but will probably still work. MutationEvent (en-US) DOM L3 The value of an attribute has been modified (use mutation observers instead).
DOMCharacterDataModified This deprecated API should no longer be used, but will probably still work. MutationEvent (en-US) DOM L3 A text or another CharacterData has changed (use mutation observers instead).
DOMContentLoaded (en-US) Event (en-US) HTML5 The document has finished loading (but not its dependent resources).
DOMElementNameChanged This deprecated API should no longer be used, but will probably still work. MutationNameEvent DOM L3 Removed The name of an element changed (use mutation observers instead).
DOMFocusIn This deprecated API should no longer be used, but will probably still work. FocusEvent (en-US) This is an experimental API that should not be used in production code. DOM L3 An element has received focus (use focus (en-US) or focusin (en-US) instead).
DOMFocusOut This deprecated API should no longer be used, but will probably still work. FocusEvent (en-US) This is an experimental API that should not be used in production code. DOM L3 An element has lost focus (use blur (en-US) or focusout (en-US) instead).
DOMNodeInserted This deprecated API should no longer be used, but will probably still work. MutationEvent (en-US) DOM L3 A node has been added as a child of another node (use mutation observers instead).
DOMNodeInsertedIntoDocument This deprecated API should no longer be used, but will probably still work. MutationEvent (en-US) DOM L3 A node has been inserted into the document (use mutation observers instead).
DOMNodeRemoved This deprecated API should no longer be used, but will probably still work. MutationEvent (en-US) DOM L3 A node has been removed from its parent node (use mutation observers instead).
DOMNodeRemovedFromDocument This deprecated API should no longer be used, but will probably still work. MutationEvent (en-US) DOM L3 A node has been removed from the document (use mutation observers instead).
DOMSubtreeModified This deprecated API should no longer be used, but will probably still work. MutationEvent (en-US) DOM L3 A change happened in the document (use mutation observers instead).
downloading Event (en-US) Offline The user agent has found an update and is fetching it, or is downloading the resources listed by the cache manifest for the first time.
drag (en-US) DragEvent (en-US) HTML5 An element or text selection is being dragged (every 350ms).
dragend (en-US) DragEvent (en-US) HTML5 A drag operation is being ended (by releasing a mouse button or hitting the escape key).
dragenter (en-US) DragEvent (en-US) HTML5 A dragged element or text selection enters a valid drop target.
dragleave (en-US) DragEvent (en-US) HTML5 A dragged element or text selection leaves a valid drop target.
dragover (en-US) DragEvent (en-US) HTML5 An element or text selection is being dragged over a valid drop target (every 350ms).
dragstart (en-US) DragEvent (en-US) HTML5 The user starts dragging an element or text selection.
drop (en-US) DragEvent (en-US) HTML5 An element is dropped on a valid drop target.
durationchange (en-US) Event (en-US) HTML5 media The duration attribute has been updated.
emptied (en-US) Event (en-US) HTML5 media The media has become empty; for example, this event is sent if the media has already been loaded (or partially loaded), and the load() method is called to reload it.
end This is an experimental API that should not be used in production code. Event (en-US) Web Speech API The speech recognition service has disconnected.
end This is an experimental API that should not be used in production code. SpeechSynthesisEvent (en-US) Web Speech API The utterance has finished being spoken.
ended (en-US) Event (en-US) HTML5 media Playback has stopped because the end of the media was reached.
ended (en-US) Event (en-US) Web Audio API Playback has stopped because the end of the media was reached.
endEvent (en-US) TimeEvent (en-US) SVG A SMIL animation element ends.
error (en-US) UIEvent (en-US) DOM L3 A resource failed to load.
error (en-US) ProgressEvent (en-US) Progress and XMLHttpRequest Progression has failed.
error (en-US) Event (en-US) Offline An error occurred while downloading the cache manifest or updating the content of the application.
error (en-US) Event (en-US) WebSocket A WebSocket connection has been closed with prejudice (some data couldn't be sent for example).
error (en-US) Event (en-US) Server Sent Events An event source connection has been failed.
error (en-US) Event (en-US) IndexedDB A request caused an error and failed.
error This is an experimental API that should not be used in production code. Event (en-US) Web Speech API A speech recognition error occurs.
error SpeechSynthesisErrorEvent (en-US) Web Speech API An error occurs that prevents the utterance from being successfully spoken.
focus (en-US) FocusEvent (en-US) This is an experimental API that should not be used in production code. DOM L3 An element has received focus (does not bubble).
focusin (en-US) FocusEvent (en-US) This is an experimental API that should not be used in production code. DOM L3 An element is about to receive focus (bubbles).
focusout (en-US) FocusEvent (en-US) This is an experimental API that should not be used in production code. DOM L3 An element is about to lose focus (bubbles).
fullscreenchange (en-US) Event (en-US) Full Screen An element was turned to fullscreen mode or back to normal mode.
fullscreenerror (en-US) Event (en-US) Full Screen It was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.
gamepadconnected (en-US) GamepadEvent (en-US) This is an experimental API that should not be used in production code. Gamepad A gamepad has been connected.
gamepaddisconnected (en-US) GamepadEvent (en-US) This is an experimental API that should not be used in production code. Gamepad A gamepad has been disconnected.
gotpointercapture PointerEvent (en-US) Pointer Events Element receives pointer capture.
hashchange (en-US) HashChangeEvent (en-US) HTML5 The fragment identifier of the URL has changed (the part of the URL after the #).
lostpointercapture PointerEvent (en-US) Pointer Events Element lost pointer capture.
input (en-US) Event (en-US) HTML5 The value of an element changes or the content of an element with the attribute contenteditable is modified.
invalid (en-US) Event (en-US) HTML5 A submittable element has been checked and doesn't satisfy its constraints.
keydown (en-US) KeyboardEvent (en-US) DOM L3 A key is pressed down.
keypress (en-US) KeyboardEvent (en-US) DOM L3 A key is pressed down and that key normally produces a character value (use input instead).
keyup (en-US) KeyboardEvent (en-US) DOM L3 A key is released.
languagechange (en-US) This is an experimental API that should not be used in production code. Event (en-US) HTML 5.1
The definition of 'NavigatorLanguage.languages' in that specification.
The user's preferred languages have changed.
levelchange Event (en-US) Battery status The level attribute has been updated.
load (en-US) UIEvent (en-US) DOM L3 A resource and its dependent resources have finished loading.
load ProgressEvent (en-US) Progress and XMLHttpRequest Progression has been successful.
loadeddata (en-US) Event (en-US) HTML5 media The first frame of the media has finished loading.
loadedmetadata (en-US) Event (en-US) HTML5 media The metadata has been loaded.
loadend (en-US) ProgressEvent (en-US) Progress and XMLHttpRequest Progress has stopped (after "error", "abort" or "load" have been dispatched).
loadstart (en-US) ProgressEvent (en-US) Progress and XMLHttpRequest Progress has begun.
mark This is an experimental API that should not be used in production code. SpeechSynthesisEvent (en-US) Web Speech API The spoken utterance reaches a named SSML "mark" tag.
message MessageEvent (en-US) WebSocket A message is received through a WebSocket.
message MessageEvent (en-US) Web Workers A message is received from a Web Worker.
message MessageEvent (en-US) Web Messaging A message is received from a child (i)frame or a parent window.
message MessageEvent (en-US) Server Sent Events A message is received through an event source.
messageerror MessageEvent (en-US) MessagePort (en-US), Web Workers, Broadcast Channel, Window A message error is raised when a message is received by an object.
message This is an experimental API that should not be used in production code. ServiceWorkerMessageEvent (en-US) or ExtendableMessageEvent (en-US), depending on context. Service Workers A message is received from a service worker, or a message is received in a service worker from another context.
mousedown (en-US) MouseEvent (en-US) DOM L3 A pointing device button (usually a mouse) is pressed on an element.
mouseenter (en-US) MouseEvent (en-US) DOM L3 A pointing device is moved onto the element that has the listener attached.
mouseleave (en-US) MouseEvent (en-US) DOM L3 A pointing device is moved off the element that has the listener attached.
mousemove (en-US) MouseEvent (en-US) DOM L3 A pointing device is moved over an element.
mouseout (en-US) MouseEvent (en-US) DOM L3 A pointing device is moved off the element that has the listener attached or off one of its children.
mouseover (en-US) MouseEvent (en-US) DOM L3 A pointing device is moved onto the element that has the listener attached or onto one of its children.
mouseup (en-US) MouseEvent (en-US) DOM L3 A pointing device button is released over an element.
nomatch This is an experimental API that should not be used in production code. SpeechRecognitionEvent (en-US) Web Speech API The speech recognition service returns a final result with no significant recognition.
notificationclick NotificationEvent (en-US) This is an experimental API that should not be used in production code. Notifications API
The definition of 'onnotificationclick' in that specification.
A system notification spawned by ServiceWorkerRegistration.showNotification() (en-US) has been clicked.
noupdate Event (en-US) Offline The manifest hadn't changed.
obsolete Event (en-US) Offline The manifest was found to have become a 404 or 410 page, so the application cache is being deleted.
offline (en-US) Event (en-US) HTML5 offline The browser has lost access to the network.
online (en-US) Event (en-US) HTML5 offline The browser has gained access to the network (but particular websites might be unreachable).
open Event (en-US) WebSocket A WebSocket connection has been established.
open Event (en-US) Server Sent Events An event source connection has been established.
orientationchange (en-US) Event (en-US) Screen Orientation The orientation of the device (portrait/landscape) has changed
pagehide (en-US) PageTransitionEvent (en-US) HTML5 A session history entry is being traversed from.
pageshow (en-US) PageTransitionEvent (en-US) HTML5 A session history entry is being traversed to.
paste (en-US) ClipboardEvent (en-US) This is an experimental API that should not be used in production code. Clipboard Data has been transferred from the system clipboard to the document.
pause (en-US) Event (en-US) HTML5 media Playback has been paused.
pause This is an experimental API that should not be used in production code. SpeechSynthesisEvent (en-US) Web Speech API The utterance is paused part way through.
pointercancel PointerEvent (en-US) Pointer Events The pointer is unlikely to produce any more events.
pointerdown PointerEvent (en-US) Pointer Events The pointer enters the active buttons state.
pointerenter PointerEvent (en-US) Pointer Events Pointing device is moved inside the hit-testing boundary.
pointerleave PointerEvent (en-US) Pointer Events Pointing device is moved out of the hit-testing boundary.
pointerlockchange (en-US) Event (en-US) Pointer Lock The pointer was locked or released.
pointerlockerror (en-US) Event (en-US) Pointer Lock It was impossible to lock the pointer for technical reasons or because the permission was denied.
pointermove PointerEvent (en-US) Pointer Events The pointer changed coordinates.
pointerout PointerEvent (en-US) Pointer Events The pointing device moved out of hit-testing boundary or leaves detectable hover range.
pointerover PointerEvent (en-US) Pointer Events The pointing device is moved into the hit-testing boundary.
pointerup PointerEvent (en-US) Pointer Events The pointer leaves the active buttons state.
play (en-US) Event (en-US) HTML5 media Playback has begun.
playing (en-US) Event (en-US) HTML5 media Playback is ready to start after having been paused or delayed due to lack of data.
popstate (en-US) PopStateEvent (en-US) HTML5 A session history entry is being navigated to (in certain cases).
progress (en-US) ProgressEvent (en-US) Progress and XMLHttpRequest In progress.
progress ProgressEvent (en-US) Offline The user agent is downloading resources listed by the manifest.
push PushEvent (en-US) This is an experimental API that should not be used in production code. Push API A Service Worker has received a push message.
pushsubscriptionchange PushEvent (en-US) This is an experimental API that should not be used in production code. Push API A PushSubscription has expired.
ratechange (en-US) Event (en-US) HTML5 media The playback rate has changed.
readystatechange (en-US) Event (en-US) HTML5 and XMLHttpRequest The readyState attribute of a document has changed.
repeatEvent (en-US) TimeEvent (en-US) SVG A SMIL animation element is repeated.
reset (en-US) Event (en-US) DOM L2, HTML5 A form is reset.
resize (en-US) UIEvent (en-US) DOM L3 The document view has been resized.
resourcetimingbufferfull Performance (en-US) Resource Timing The browser's resource timing buffer is full.
result This is an experimental API that should not be used in production code. SpeechRecognitionEvent (en-US) This is an experimental API that should not be used in production code. Web Speech API The speech recognition service returns a result — a word or phrase has been positively recognized and this has been communicated back to the app.
resume This is an experimental API that should not be used in production code. SpeechSynthesisEvent (en-US) This is an experimental API that should not be used in production code. Web Speech API A paused utterance is resumed.
scroll (en-US) UIEvent (en-US) DOM L3 The document view or an element has been scrolled.
seeked (en-US) Event (en-US) HTML5 media A seek operation completed.
seeking (en-US) Event (en-US) HTML5 media A seek operation began.
select (en-US) UIEvent (en-US) DOM L3 Some text is being selected.
selectstart This is an experimental API that should not be used in production code. Event (en-US) Selection API A selection just started.
selectionchange This is an experimental API that should not be used in production code. Event (en-US) Selection API The selection in the document has been changed.
show (en-US) MouseEvent (en-US) HTML5 A contextmenu event was fired on/bubbled to an element that has a contextmenu attribute
slotchange Event (en-US) DOM The node contents of a HTMLSlotElement (en-US) (<slot> (en-US)) have changed.
soundend This is an experimental API that should not be used in production code. Event (en-US) Web Speech API Any sound — recognisable speech or not — has stopped being detected.
soundstart This is an experimental API that should not be used in production code. Event (en-US) Web Speech API Any sound — recognisable speech or not — has been detected.
speechend This is an experimental API that should not be used in production code. Event (en-US) Web Speech API Speech recognised by the speech recognition service has stopped being detected.
speechstart This is an experimental API that should not be used in production code. Event (en-US) Web Speech API Sound that is recognised by the speech recognition service as speech has been detected.
stalled (en-US) Event (en-US) HTML5 media The user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
start This is an experimental API that should not be used in production code. Event (en-US) Web Speech API The speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition.
start SpeechSynthesisEvent (en-US) Web Speech API The utterance has begun to be spoken.
storage (en-US) StorageEvent (en-US) Web Storage A storage area (localStorage or sessionStorage) has changed.
submit (en-US) Event (en-US) DOM L2, HTML5 A form is submitted.
success Event (en-US) IndexedDB A request successfully completed.
suspend (en-US) Event (en-US) HTML5 media Media data loading has been suspended.
SVGAbort (en-US) SVGEvent (en-US) SVG Page loading has been stopped before the SVG was loaded.
SVGError (en-US) SVGEvent (en-US) SVG An error has occurred before the SVG was loaded.
SVGLoad (en-US) SVGEvent (en-US) SVG An SVG document has been loaded and parsed.
SVGResize (en-US) SVGEvent (en-US) SVG An SVG document is being resized.
SVGScroll (en-US) SVGEvent (en-US) SVG An SVG document is being scrolled.
SVGUnload (en-US) SVGEvent (en-US) SVG An SVG document has been removed from a window or frame.
SVGZoom SVGZoomEvent SVG An SVG document is being zoomed.
timeout ProgressEvent (en-US) XMLHttpRequest
timeupdate (en-US) Event (en-US) HTML5 media The time indicated by the currentTime attribute has been updated.
touchcancel (en-US) TouchEvent (en-US) Touch Events A touch point has been disrupted in an implementation-specific manners (too many touch points for example).
touchend (en-US) TouchEvent (en-US) Touch Events A touch point is removed from the touch surface.
touchmove (en-US) TouchEvent (en-US) Touch Events A touch point is moved along the touch surface.
touchstart (en-US) TouchEvent (en-US) Touch Events A touch point is placed on the touch surface.
transitionend (en-US) TransitionEvent (en-US) This is an experimental API that should not be used in production code. CSS Transitions A CSS transition has completed.
unload (en-US) UIEvent (en-US) DOM L3 The document or a dependent resource is being unloaded.
updateready Event (en-US) Offline The resources listed in the manifest have been newly redownloaded, and the script can use swapCache() to switch to the new cache.
upgradeneeded IndexedDB An attempt was made to open a database with a version number higher than its current version. A versionchange transaction has been created.
userproximity UserProximityEvent (en-US) This is an experimental API that should not be used in production code. Proximity Sensor Fresh data is available from a proximity sensor (indicates whether the nearby object is near the device or not).
voiceschanged This is an experimental API that should not be used in production code. Event (en-US) Web Speech API The list of SpeechSynthesisVoice (en-US) objects that would be returned by the SpeechSynthesis.getVoices() (en-US) method has changed (when the voiceschanged event fires.)
versionchange IndexedDB A versionchange transaction completed.
visibilitychange (en-US) Event (en-US) Page visibility The content of a tab has become visible or has been hidden.
volumechange (en-US) Event (en-US) HTML5 media The volume has changed.
waiting (en-US) Event (en-US) HTML5 media Playback has stopped because of a temporary lack of data.
wheel (en-US) WheelEvent (en-US) DOM L3 A wheel button of a pointing device is rotated in any direction.

Non-standard events

Event Name Event Type Specification Fired when...
afterscriptexecute (en-US) Event (en-US) Mozilla Specific A script has been executed.
beforescriptexecute (en-US) Event (en-US) Mozilla Specific A script is about to be executed.
beforeinstallprompt Event (en-US) Chrome specific A user is prompted to save a web site to a home screen on mobile.
cardstatechange Firefox OS specific The MozMobileConnection.cardState property changes value.
change (en-US) DeviceStorageChangeEvent Firefox OS specific This event is triggered each time a file is created, modified or deleted on a given storage area.
connectionInfoUpdate Firefox OS specific The informations about the signal strength and the link speed have been updated.
cfstatechange Firefox OS specific The call forwarding state changes.
datachange Firefox OS specific The MozMobileConnection.data object changes values.
dataerror Firefox OS specific The MozMobileConnection.data object receive an error from the RIL.
DOMMouseScroll (en-US) This deprecated API should no longer be used, but will probably still work. Mozilla specific The wheel button of a pointing device is rotated (detail attribute is a number of lines). (use wheel (en-US) instead)
dragdrop  This deprecated API should no longer be used, but will probably still work. DragEvent Mozilla specific An element is dropped (use drop (en-US) instead).
dragexit  This deprecated API should no longer be used, but will probably still work. DragEvent Mozilla specific A drag operation is being ended(use dragend (en-US) instead).
draggesture  This deprecated API should no longer be used, but will probably still work. DragEvent Mozilla specific The user starts dragging an element or text selection (use dragstart (en-US) instead).
icccardlockerror Firefox OS specific the MozMobileConnection.unlockCardLock() or MozMobileConnection.setCardLock() methods fails.
iccinfochange Firefox OS specific The MozMobileConnection.iccInfo object changes.
localized Mozilla Specific The page has been localized using data-l10n-* attributes.
mousewheel (en-US) This deprecated API should no longer be used, but will probably still work. IE invented The wheel button of a pointing device is rotated.
MozAudioAvailable Event (en-US) Mozilla specific The audio buffer is full and the corresponding raw samples are available.
MozBeforeResize  This is an obsolete API and is no longer guaranteed to work. Mozilla specific A window is about to be resized.
mozbrowseractivitydone Firefox OS Browser API-specific Sent when some activity has been completed (complete description TBD.)
mozbrowserasyncscroll Firefox OS Browser API-specific Sent when the scroll position within a browser <iframe> (en-US) changes.
mozbrowseraudioplaybackchange Firefox OS Browser API-specific Sent when audio starts or stops playing within the browser <iframe> (en-US) content.
mozbrowsercaretstatechanged Firefox OS Browser API-specific Sent when the text selected inside the browser <iframe> (en-US) content changes.
mozbrowserclose Firefox OS Browser API-specific Sent when window.close() is called within a browser <iframe> (en-US).
mozbrowsercontextmenu Firefox OS Browser API-specific Sent when a browser <iframe> (en-US) try to open a context menu.
mozbrowserdocumentfirstpaint Firefox OS Browser API-specific Sent when a new paint occurs on any document in the browser <iframe> (en-US).
mozbrowsererror Firefox OS Browser API-specific Sent when an error occured while trying to load a content within a browser iframe
mozbrowserfindchange Firefox OS Browser API-specific Sent when a search operation is performed on the browser <iframe> (en-US) content (see HTMLIFrameElement search methods.)
mozbrowserfirstpaint Firefox OS Browser API-specific Sent when the <iframe> (en-US) paints content for the first time (this doesn't include the initial paint from about:blank.)
mozbrowsericonchange Firefox OS Browser API-specific Sent when the favicon of a browser iframe changes.
mozbrowserlocationchange Firefox OS Browser API-specific Sent when an browser iframe's location changes.
mozbrowserloadend Firefox OS Browser API-specific Sent when the browser iframe has finished loading all its assets.
mozbrowserloadstart Firefox OS Browser API-specific Sent when the browser iframe starts to load a new page.
mozbrowsermanifestchange Firefox OS Browser API-specific Sent when a the path to the app manifest changes, in the case of a browser <iframe> (en-US) with an open web app embedded in it.
mozbrowsermetachange Firefox OS Browser API-specific Sent when a <meta> elelment is added to, removed from or changed in the browser <iframe> (en-US)'s content.
mozbrowseropensearch Firefox OS Browser API-specific Sent when a link to a search engine is found.
mozbrowseropentab Firefox OS Browser API-specific Sent when a new tab is opened within a browser <iframe> (en-US) as a result of the user issuing a command to open a link target in a new tab (for example ctrl/cmd + click.)
mozbrowseropenwindow Firefox OS Browser API-specific Sent when window.open() (en-US) is called within a browser iframe.
mozbrowserresize Firefox OS Browser API-specific Sent when the browser <iframe> (en-US)'s window size has changed.
mozbrowserscroll Firefox OS Browser API-specific Sent when the browser <iframe> (en-US) content scrolls.
mozbrowserscrollareachanged Firefox OS Browser API-specific Sent when the available scrolling area in the browser <iframe> (en-US) changes. This can occur on resize and when the page size changes (while loading for example.)
mozbrowserscrollviewchange Firefox OS Browser API-specific Sent when asynchronous scrolling (i.e. APCZ) starts or stops.
mozbrowsersecuritychange Firefox OS Browser API-specific Sent when the SSL state changes within a browser iframe.
mozbrowserselectionstatechanged Firefox OS Browser API-specific Sent when the text selected inside the browser <iframe> (en-US) content changes. Note that this is deprecated, and newer implementations use mozbrowsercaretstatechanged instead.
mozbrowsershowmodalprompt Firefox OS Browser API-specific Sent when alert() (en-US), confirm() (en-US) or prompt() are called within a browser iframe
mozbrowsertitlechange Firefox OS Browser API-specific Sent when the document.title changes within a browser iframe.
mozbrowserusernameandpasswordrequired Firefox OS Browser API-specific Sent when an HTTP authentification is requested.
mozbrowservisibilitychange Firefox OS Browser API-specific Sent when the visibility state of the current browser iframe <iframe> (en-US) changes, for example due to a call to setVisible().
MozGamepadButtonDown To be specified A gamepad button is pressed down.
MozGamepadButtonUp To be specified A gamepad button is released.
MozMousePixelScroll (en-US)  This deprecated API should no longer be used, but will probably still work. Mozilla specific The wheel button of a pointing device is rotated (detail attribute is a number of pixels). (use wheel instead)
MozOrientation  This deprecated API should no longer be used, but will probably still work. Mozilla specific Fresh data is available from an orientation sensor (see deviceorientation).
MozScrolledAreaChanged UIEvent (en-US) Mozilla specific The document view has been scrolled or resized.
moztimechange Mozilla specific The time of the device has been changed.
MozTouchDown  This deprecated API should no longer be used, but will probably still work. Mozilla specific A touch point is placed on the touch surface (use touchstart instead).
MozTouchMove  This deprecated API should no longer be used, but will probably still work. Mozilla specific A touch point is moved along the touch surface (use touchmove instead).
MozTouchUp  This deprecated API should no longer be used, but will probably still work. Mozilla specific A touch point is removed from the touch surface (use touchend instead).
alerting CallEvent To be specified The correspondent is being alerted (his/her phone is ringing).
busy CallEvent To be specified The line of the correspondent is busy.
callschanged CallEvent To be specified A call has been added or removed from the list of current calls.
onconnected connected CallEvent To be specified A call has been connected.
connecting CallEvent To be specified A call is about to connect.
delivered SMSEvent To be specified An SMS has been successfully delivered.
dialing CallEvent To be specified The number of a correspondent has been dialed.
disabled Firefox OS specific Wifi has been disabled on the device.
disconnected CallEvent To be specified A call has been disconnected.
disconnecting CallEvent To be specified A call is about to disconnect.
enabled Firefox OS specific Wifi has been enabled on the device.
error CallEvent To be specified An error occurred.
held CallEvent To be specified A call has been held.
holding CallEvent To be specified A call is about to be held.
incoming CallEvent To be specified A call is being received.
received SMSEvent To be specified An SMS has been received.
resuming CallEvent To be specified A call is about to resume.
sent SMSEvent To be specified An SMS has been sent.
statechange (en-US) CallEvent To be specified The state of a call has changed.
statuschange Firefox OS specific The status of the Wifi connection changed.
overflow (en-US) UIEvent (en-US) Mozilla specific An element has been overflowed by its content or has been rendered for the first time in this state (only works for elements styled with overflow != visible).
smartcard-insert Mozilla specific A smartcard has been inserted.
smartcard-remove Mozilla specific A smartcard has been removed.
stkcommand Firefox OS specific The STK Proactive Command is issued from ICC.
stksessionend Firefox OS specific The STK Session is terminated by ICC.
touchenter TouchEvent (en-US) Touch Events Removed
touchleave TouchEvent (en-US) Touch Events Removed
underflow (en-US) UIEvent (en-US) Mozilla specific An element is no longer overflowed by its content (only works for elements styled with overflow != visible).
uploadprogress  This deprecated API should no longer be used, but will probably still work. ProgressEvent (en-US) Mozilla Specific Upload is in progress (see progress (en-US)).

ussdreceived

Firefox OS specific A new USSD message is received
voicechange Firefox OS specific The MozMobileConnection.voice object changes values.
msContentZoom Microsoft specific
MSManipulationStateChanged Microsoft specific
MSPointerHover  This deprecated API should no longer be used, but will probably still work. Microsoft specific

Mozilla-specific events

Note: those events are never exposed to web content and can only be used in chrome content context.

XUL events

Event Name Event Type Specification Fired when...
broadcast XUL An observer noticed a change to the attributes of a watched broadcaster.
CheckboxStateChange XUL The state of a checkbox has been changed either by a user action or by a script (useful for accessibility).
close XUL The close button of the window has been clicked.
command XUL An element has been activated.
commandupdate XUL A command update occurred on a commandset element.
DOMMenuItemActive XUL A menu or menuitem has been hovered or highlighted.
DOMMenuItemInactive XUL A menu or menuitem is no longer hovered or highlighted.
popuphidden PopupEvent XUL A menupopup, panel or tooltip has been hidden.
popuphiding PopupEvent XUL A menupopup, panel or tooltip is about to be hidden.
popupshowing PopupEvent XUL A menupopup, panel or tooltip is about to become visible.
popupshown PopupEvent XUL A menupopup, panel or tooltip has become visible.
RadioStateChange XUL The state of a radio has been changed either by a user action or by a script (useful for accessibility).
ValueChange XUL The value of an element has changed (a progress bar for example, useful for accessibility).

Add-on-specific events

Event Name Event Type Specification Fired when...
MozSwipeGesture Addons specific A touch point is swiped across the touch surface
MozMagnifyGestureStart Addons specific Two touch points start to move away from each other.
MozMagnifyGestureUpdate Addons specific Two touch points move away from each other (after a MozMagnifyGestureStart).
MozMagnifyGesture Addons specific Two touch points moved away from each other (after a sequence of MozMagnifyGestureUpdate).
MozRotateGestureStart Addons specific Two touch points start to rotate around a point.
MozRotateGestureUpdate Addons specific Two touch points rotate around a point (after a MozRotateGestureStart).
MozRotateGesture Addons specific Two touch points rotate around a point (after a sequence of MozRotateGestureUpdate).
MozTapGesture Addons specific Two touch points are tapped on the touch surface.
MozPressTapGesture Addons specific A "press-tap" gesture happened on the touch surface (first finger down, second finger down, second finger up, first finger up).
MozEdgeUIGesture Addons specific A touch point is swiped across the touch surface to invoke the edge UI (Win8 only).
MozAfterPaint Addons specific Content has been repainted.
DOMPopupBlocked Addons specific A popup has been blocked
DOMWindowCreated Addons specific A window has been created.
DOMWindowClose Addons specific A window is about to be closed.
DOMTitleChanged Addons specifc The title of a window has changed.
DOMLinkAdded Addons specifc A link has been added a document.
DOMLinkRemoved Addons specifc A link has been removed inside from a document.
DOMMetaAdded Addons specific A meta element has been added to a document.
DOMMetaRemoved Addons specific A meta element has been removed from a document.
DOMWillOpenModalDialog Addons specific A modal dialog is about to open.
DOMModalDialogClosed Addons specific A modal dialog has been closed.
DOMAutoComplete Addons specific The content of an element has been auto-completed.
DOMFrameContentLoaded Addons specific The frame has finished loading (but not its dependent resources).
AlertActive Addons specific A notification element is shown.
AlertClose Addons specific A notification element is closed.
fullscreen Addons specific Browser fullscreen mode has been entered or left.
sizemodechange Addons specific Window has entered/left fullscreen mode, or has been minimized/unminimized.
MozEnteredDomFullscreen Addons specific DOM fullscreen mode has been entered.
SSWindowClosing Addons specific The session store will stop tracking this window.
SSTabClosing Addons specific The session store will stop tracking this tab.
SSTabRestoring Addons specific A tab is about to be restored.
SSTabRestored Addons specific A tab has been restored.
SSWindowStateReady Addons specific A window state has switched to "ready".
SSWindowStateBusy Addons specific A window state has switched to "busy".
TabOpen Addons specific A tab has been opened.
TabClose Addons specific A tab has been closed.
TabSelect Addons specific A tab has been selected.
TabShow Addons specific A tab has been shown.
TabHide Addons specific A tab has been hidden.
TabPinned Addons specific A tab has been pinned.
TabUnpinned Addons specific A tab has been unpinned.

Developer tool-specific events

Event Name Event Type Specification Fired when...
CssRuleViewRefreshed devtools specific The "Rules" view of the style inspector has been updated.
CssRuleViewChanged devtools specific The "Rules" view of the style inspector has been changed.
CssRuleViewCSSLinkClicked devtools specific A link to a CSS file has been clicked in the "Rules" view of the style inspector.

See also