Event reference 编辑

DOM Events are sent to notify code of interesting things that have taken place. Each event is represented by an object which is based on the Event interface, and may have additional custom fields and/or functions used to get additional information about what happened. Events can represent everything from basic user interactions to automated notifications of things happening in the rendering model.

This article offers a list of events that can be sent; some are standard events defined in official specifications, while others are events used internally by specific browsers; for example, Mozilla-specific events are listed so that add-ons can use them to interact with the browser.

Most common categories

Resource events

Event NameFired When
errorA resource failed to load.
abortThe loading of a resource has been aborted.
loadA resource and its dependent resources have finished loading.
beforeunloadThe window, the document and its resources are about to be unloaded.
unloadThe document or a dependent resource is being unloaded.

Network events

Event NameFired When
onlineThe browser has gained access to the network.
offlineThe browser has lost access to the network.

Focus events

Event NameFired When
focusAn element has received focus (does not bubble).
blurAn element has lost focus (does not bubble).
focusinAn element is about to receive focus (does bubble).
focusoutAn element is about to lose focus (does bubble).

WebSocket events

Event NameFired When
openA WebSocket connection has been established.
messageA message is received through a WebSocket.
errorA WebSocket connection has been closed with prejudice (some data couldn't be sent for example).
closeA WebSocket connection has been closed.

Session History events

Event NameFired When
pagehideA session history entry is being traversed from.
pageshowA session history entry is being traversed to.
popstateA session history entry is being navigated to (in certain cases).

CSS Animation events

Event NameFired When
animationstartA CSS animation has started.
animationcancelA CSS animation has aborted.
animationendA CSS animation has completed.
animationiterationA CSS animation is repeated.

CSS Transition events

Event NameFired When
transitionstartA CSS transition has actually started (fired after any delay).
transitioncancelA CSS transition has been cancelled.
transitionendA CSS transition has completed.
transitionrunA CSS transition has begun running (fired before any delay starts).

Form events

Event NameFired When
resetThe reset button is pressed
submitThe submit button is pressed

Printing events

Event NameFired When
beforeprintThe print dialog is opened
afterprintThe print dialog is closed

Text Composition events

Event NameFired When
compositionstartThe composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
compositionupdateA character is added to a passage of text being composed.
compositionendThe composition of a passage of text has been completed or canceled.

View events

Event NameFired When
fullscreenchangeAn element was toggled to or from fullscreen mode.
fullscreenerrorIt was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.
resizeThe document view has been resized.
scrollThe document view or an element has been scrolled.

Clipboard events

Event NameFired When
cutThe selection has been cut and copied to the clipboard
copyThe selection has been copied to the clipboard
pasteThe item from the clipboard has been pasted

Keyboard events

Event NameFired When
keydownANY key is pressed
keypressANY key (except Shift, Fn, or CapsLock) is in a pressed position (fired continuously).
keyupANY key is released

Mouse events

Event NameFired When
auxclickA pointing device button (ANY non-primary button) has been pressed and released on an element.
clickA pointing device button (ANY button; soon to be primary button only) has been pressed and released on an element.
contextmenuThe right button of the mouse is clicked (before the context menu is displayed).
dblclickA pointing device button is clicked twice on an element.
mousedownA pointing device button is pressed on an element.
mouseenterA pointing device is moved onto the element that has the listener attached.
mouseleaveA pointing device is moved off the element that has the listener attached.
mousemoveA pointing device is moved over an element (fired continuously as the mouse moves).
mouseoverA pointing device is moved onto the element that has the listener attached or onto one of its children.
mouseoutA pointing device is moved off the element that has the listener attached or off one of its children.
mouseupA pointing device button is released over an element.
pointerlockchangeThe pointer was locked or released.
pointerlockerrorIt was impossible to lock the pointer for technical reasons or because the permission was denied.
selectSome text is being selected.
wheelA wheel button of a pointing device is rotated in any direction.

Drag & Drop events

Event NameFired When
dragAn element or text selection is being dragged (fired continuously every 350ms).
dragendA drag operation is being ended (by releasing a mouse button or hitting the escape key).
dragenterA dragged element or text selection enters a valid drop target.
dragstartThe user starts dragging an element or text selection.
dragleaveA dragged element or text selection leaves a valid drop target.
dragoverAn element or text selection is being dragged over a valid drop target (fired continuously every 350ms).
dropAn element is dropped on a valid drop target.

Media events

Event NameFired When
audioprocessThe input buffer of a ScriptProcessorNode is ready to be processed.
canplayThe 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.
canplaythroughThe browser estimates it can play the media up to its end without stopping for content buffering.
completeThe rendering of an OfflineAudioContext is terminated.
durationchangeThe duration attribute has been updated.
emptiedThe 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.
endedPlayback has stopped because the end of the media was reached.
loadeddataThe first frame of the media has finished loading.
loadedmetadataThe metadata has been loaded.
pausePlayback has been paused.
playPlayback has begun.
playingPlayback is ready to start after having been paused or delayed due to lack of data.
ratechangeThe playback rate has changed.
seekedA seek operation completed.
seekingA seek operation began.
stalledThe user agent is trying to fetch media data, but data is unexpectedly not forthcoming.
suspendMedia data loading has been suspended.
timeupdateThe time indicated by the currentTime attribute has been updated.
volumechangeThe volume has changed.
waitingPlayback has stopped because of a temporary lack of data.

Progress events

Event NameFired When
abortProgression has been terminated (not due to an error).
errorProgression has failed.
loadProgression has been successful.
loadendProgress has stopped (after "error", "abort", or "load" have been dispatched).
loadstartProgress has begun.
progressIn progress.
timeoutProgression is terminated due to preset time expiring.

Storage events

change (see Non-standard events)
storage

Update events

checking
downloading
error
noupdate
obsolete
updateready

Value change events

broadcast
CheckboxStateChange
hashchange
input
RadioStateChange
readystatechange
ValueChange

Uncategorized events

invalid
message
message
open
show

Less common and non-standard events

Abortable Fetch events

Event nameFired when
abortA DOM request is aborted, i.e. using AbortController.abort().

WebVR events

Event nameFired when
vrdisplayactivateWhen 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.
vrdisplayblurwhen presentation to a VRDisplay 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.
vrdisplayconnectwhen a compatible VRDisplay is connected to the computer.
vrdisplaydeactivateWhen a VRDisplay can no longer be presented to, for example if an HMD has gone into standby or sleep mode due to a period of inactivity.
vrdisplaydisconnectWhen a compatible VRDisplay is disconnected from the computer.
vrdisplayfocusWhen presentation to a VRDisplay has resumed after being blurred.
vrdisplaypresentchangeThe presenting state of a VRDisplay changes — i.e. goes from presenting to not presenting, or vice versa.

SVG events

SVGAbort
SVGError
SVGLoad
SVGResize
SVGScroll
SVGUnload
SVGZoom

Database events

abort
blocked
complete
error
success
upgradeneeded
versionchange

Script events

afterscriptexecute
beforescriptexecute

DOMMenuItemActive
DOMMenuItemInactive

Window events

close

popuphidden
popuphiding
popupshowing
popupshown

Tab events

visibilitychange

    Battery events

    chargingchange
    chargingtimechange
    dischargingtimechange
    levelchange

    Call events

    alerting
    busy
    callschanged
    cfstatechange
    connected
    connecting
    dialing
    disconnected
    disconnecting
    error
    held, holding
    incoming
    resuming
    statechange
    voicechange

    Sensor events

    compassneedscalibration
    devicemotion
    deviceorientation
    orientationchange

    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
    mozbrowsertitlechange

    DOM mutation events

    DOMAttributeNameChanged
    DOMAttrModified
    DOMCharacterDataModified
    DOMContentLoaded
    DOMElementNameChanged
    DOMNodeInserted
    DOMNodeInsertedIntoDocument
    DOMNodeRemoved
    DOMNodeRemovedFromDocument
    DOMSubtreeModified

    Touch events

    touchcancel
    touchend
    touchmove
    touchstart

    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 NameEvent TypeSpecificationFired when...
    abortUIEventDOM L3The loading of a resource has been aborted.
    abortProgressEventProgress and XMLHttpRequestProgression has been terminated (not due to an error).
    abortEventIndexedDBA transaction has been aborted.
    afterprintEventHTML5The associated document has started printing or the print preview has been closed.
    animationcancelAnimationEvent This is an experimental API that should not be used in production code.CSS AnimationsA CSS animation has aborted.
    animationendAnimationEvent This is an experimental API that should not be used in production code.CSS AnimationsA CSS animation has completed.
    animationiterationAnimationEvent This is an experimental API that should not be used in production code.CSS AnimationsA CSS animation is repeated.
    animationstartAnimationEvent This is an experimental API that should not be used in production code.CSS AnimationsA CSS animation has started.
    appinstalledEventWeb App ManifestA web application is successfully installed as a progressive web app.
    audioprocessAudioProcessingEvent 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 is ready to be processed.
    audioend This is an experimental API that should not be used in production code.EventWeb Speech APIThe user agent has finished capturing audio for speech recognition.
    audiostart This is an experimental API that should not be used in production code.EventWeb Speech APIThe user agent has started to capture audio for speech recognition.
    beforeprintEventHTML5The associated document is about to be printed or previewed for printing.
    beforeunloadBeforeUnloadEventHTML5The window, the document and its resources are about to be unloaded.
    beginEventTimeEventSVGA SMIL animation element begins.
    blockedIndexedDBAn open connection to a database is blocking a versionchange transaction on the same database.
    blurFocusEvent This is an experimental API that should not be used in production code.DOM L3An element has lost focus (does not bubble).
    boundary This is an experimental API that should not be used in production code.SpeechSynthesisEventWeb Speech APIThe spoken utterance reaches a word or sentence boundary
    canplayEventHTML5 mediaThe 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.
    canplaythroughEventHTML5 mediaThe user agent can play the media up to its end without having to stop for further buffering of content.
    changeEventDOM L2, HTML5The change event is fired for <input>, <select>, and <textarea> elements when a change to the element's value is committed by the user.
    chargingchangeEventBattery statusThe battery begins or stops charging.
    chargingtimechangeEventBattery statusThe chargingTime attribute has been updated.
    clickMouseEventDOM L3A pointing device button has been pressed and released on an element.
    closeEventWebSocketA WebSocket connection has been closed.
    completeIndexedDBA transaction successfully completed.
    completeOfflineAudioCompletionEvent 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 is terminated.
    compositionendCompositionEventDOM L3The composition of a passage of text has been completed or canceled.
    compositionstartCompositionEventDOM L3The composition of a passage of text is prepared (similar to keydown for a keyboard input, but works with other inputs such as speech recognition).
    compositionupdateCompositionEventDOM L3A character is added to a passage of text being composed.
    contextmenuMouseEventHTML5The right button of the mouse is clicked (before the context menu is displayed).
    copyClipboardEvent This is an experimental API that should not be used in production code.ClipboardThe text selection has been added to the clipboard.
    cutClipboardEvent This is an experimental API that should not be used in production code.ClipboardThe text selection has been removed from the document and added to the clipboard.
    dblclickMouseEventDOM L3A pointing device button is clicked twice on an element.
    devicechangeEventMedia Capture and StreamsA media device such as a camera, microphone, or speaker is connected or removed from the system.
    devicemotionDeviceMotionEvent This is an experimental API that should not be used in production code.Device Orientation EventsFresh data is available from a motion sensor.
    deviceorientationDeviceOrientationEvent This is an experimental API that should not be used in production code.Device Orientation EventsFresh data is available from an orientation sensor.
    dischargingtimechangeEventBattery statusThe dischargingTime attribute has been updated.
    DOMActivate This deprecated API should no longer be used, but will probably still work.UIEventDOM L3A button, link, or state changing element is activated (use click instead).
    DOMAttributeNameChanged This deprecated API should no longer be used, but will probably still work.MutationNameEventDOM L3 RemovedThe name of an attribute changed (use mutation observers instead).
    DOMAttrModified This deprecated API should no longer be used, but will probably still work.MutationEventDOM L3The 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.MutationEventDOM L3A text or another CharacterData has changed (use mutation observers instead).
    DOMContentLoadedEventHTML5The document has finished loading (but not its dependent resources).
    DOMElementNameChanged This deprecated API should no longer be used, but will probably still work.MutationNameEventDOM L3 RemovedThe name of an element changed (use mutation observers instead).
    DOMFocusIn This deprecated API should no longer be used, but will probably still work.FocusEvent This is an experimental API that should not be used in production code.DOM L3An element has received focus (use focus or focusin instead).
    DOMFocusOut This deprecated API should no longer be used, but will probably still work.FocusEvent This is an experimental API that should not be used in production code.DOM L3An element has lost focus (use blur or focusout instead).
    DOMNodeInserted This deprecated API should no longer be used, but will probably still work.MutationEventDOM L3A 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.MutationEventDOM L3A 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.MutationEventDOM L3A 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.MutationEventDOM L3A 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.MutationEventDOM L3A change happened in the document (use mutation observers instead).
    dragDragEventHTML5An element or text selection is being dragged (every 350ms).
    dragendDragEventHTML5A drag operation is being ended (by releasing a mouse button or hitting the escape key).
    dragenterDragEventHTML5A dragged element or text selection enters a valid drop target.
    dragleaveDragEventHTML5A dragged element or text selection leaves a valid drop target.
    dragoverDragEventHTML5An element or text selection is being dragged over a valid drop target (fires every 350ms).
    dragstartDragEventHTML5The user starts dragging an element or text selection.
    dropDragEventHTML5An element is dropped on a valid drop target.
    durationchangeEventHTML5 mediaThe duration attribute has been updated.
    emptiedEventHTML5 mediaThe media has become empty. For example, this event is triggered 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.EventWeb Speech APIThe speech recognition service has disconnected.
    end This is an experimental API that should not be used in production code.SpeechSynthesisEventWeb Speech APIThe utterance has finished being spoken.
    endedEventHTML5 mediaPlayback has stopped because the end of the media was reached.
    endedEventWeb Audio APIPlayback has stopped because the end of the media was reached.
    endEventTimeEventSVGA SMIL animation element ends.
    errorUIEventDOM L3A resource failed to load.
    errorProgressEventProgress and XMLHttpRequestProgression has failed.
    errorEventWebSocketA WebSocket connection has been closed with prejudice (some data couldn't be sent for example).
    errorEventServer Sent EventsAn event source connection has been failed.
    errorEventIndexedDBA request caused an error and failed.
    error This is an experimental API that should not be used in production code.EventWeb Speech APIA speech recognition error occurs.
    errorSpeechSynthesisErrorEventWeb Speech APIAn error occurs that prevents the utterance from being successfully spoken.
    focusFocusEvent This is an experimental API that should not be used in production code.DOM L3An element has received focus (does not bubble).
    focusinFocusEvent This is an experimental API that should not be used in production code.DOM L3An element is about to receive focus (bubbles).
    focusoutFocusEvent This is an experimental API that should not be used in production code.DOM L3An element is about to lose focus (bubbles).
    fullscreenchangeEventFull ScreenAn element was toggled to or from fullscreen mode.
    fullscreenerrorEventFull ScreenIt was impossible to switch to fullscreen mode for technical reasons or because the permission was denied.
    gamepadconnectedGamepadEvent This is an experimental API that should not be used in production code.GamepadA gamepad has been connected.
    gamepaddisconnectedGamepadEvent This is an experimental API that should not be used in production code.GamepadA gamepad has been disconnected.
    gotpointercapturePointerEventPointer EventsElement receives pointer capture.
    hashchangeHashChangeEventHTML5The fragment identifier of the URL has changed (the part of the URL after the #).
    lostpointercapturePointerEventPointer EventsElement lost pointer capture.
    inputEventHTML5The value of an element changes or the content of an element with the attribute contenteditable is modified.
    invalidEventHTML5A submittable element has been checked and doesn't satisfy its constraints.
    keydownKeyboardEventDOM L3A key is pressed down.
    keypress This deprecated API should no longer be used, but will probably still work.KeyboardEventDOM L3A key is pressed down, and that key normally produces a character value (use input event instead).
    keyupKeyboardEventDOM L3A key is released.
    languagechange This is an experimental API that should not be used in production code.EventHTML 5.1
    The definition of 'NavigatorLanguage.languages' in that specification.
    The user's preferred languages have changed.
    levelchangeEventBattery statusThe level attribute has been updated.
    loadUIEventDOM L3A resource and its dependent resources have finished loading.
    loadProgressEventProgress and XMLHttpRequestProgression has been successful.
    loadeddataEventHTML5 mediaThe first frame of the media has finished loading.
    loadedmetadataEventHTML5 mediaThe metadata has been loaded.
    loadendProgressEventProgress and XMLHttpRequestProgress has stopped (after "error", "abort", or "load" have been dispatched).
    loadstartProgressEventProgress and XMLHttpRequestProgress has begun.
    mark This is an experimental API that should not be used in production code.SpeechSynthesisEventWeb Speech APIThe spoken utterance reaches a named SSML "mark" tag.
    messageMessageEventWebSocketA message is received through a WebSocket.
    messageMessageEventWeb WorkersA message is received from a Web Worker.
    messageMessageEventWeb MessagingA message is received from a child (i)frame or a parent window.
    messageMessageEventServer Sent EventsA message is received through an event source.
    messageerrorMessageEventMessagePort, Web Workers, Broadcast Channel, WindowA 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 or ExtendableMessageEvent, depending on context.Service WorkersA message is received from a service worker, or a message is received in a service worker from another context.
    mousedownMouseEventDOM L3A pointing device button (usually a mouse) is pressed on an element.
    mouseenterMouseEventDOM L3A pointing device is moved onto the element that has the listener attached.
    mouseleaveMouseEventDOM L3A pointing device is moved off the element that has the listener attached.
    mousemoveMouseEventDOM L3A pointing device is moved over an element.
    mouseoutMouseEventDOM L3A pointing device is moved off the element that has the listener attached or off one of its children.
    mouseoverMouseEventDOM L3A pointing device is moved onto the element that has the listener attached or onto one of its children.
    mouseupMouseEventDOM L3A pointing device button is released over an element.
    nomatch This is an experimental API that should not be used in production code.SpeechRecognitionEventWeb Speech APIThe speech recognition service returns a final result with no significant recognition.
    notificationclickNotificationEvent 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() has been clicked.
    offlineEventHTML5 offlineThe browser has lost access to the network.
    onlineEventHTML5 offlineThe browser has gained access to the network (but particular websites might be unreachable).
    openEventWebSocketA WebSocket connection has been established.
    openEventServer Sent EventsAn event source connection has been established.
    orientationchangeEventScreen OrientationThe orientation of the device (portrait/landscape) has changed.
    pagehidePageTransitionEventHTML5A session history entry is being traversed from.
    pageshowPageTransitionEventHTML5A session history entry is being traversed to.
    pasteClipboardEvent This is an experimental API that should not be used in production code.ClipboardData has been transferred from the system clipboard to the document.
    pauseEventHTML5 mediaPlayback has been paused.
    pause This is an experimental API that should not be used in production code.SpeechSynthesisEventWeb Speech APIThe utterance is paused part way through.
    pointercancelPointerEventPointer EventsThe pointer is unlikely to produce any more events.
    pointerdownPointerEventPointer EventsThe pointer enters the active buttons state.
    pointerenterPointerEventPointer EventsPointing device is moved inside the hit-testing boundary.
    pointerleavePointerEventPointer EventsPointing device is moved out of the hit-testing boundary.
    pointerlockchangeEventPointer LockThe pointer was locked or released.
    pointerlockerrorEventPointer LockIt was impossible to lock the pointer for technical reasons or because the permission was denied.
    pointermovePointerEventPointer EventsThe pointer changed coordinates.
    pointeroutPointerEventPointer EventsThe pointing device moves out of the hit-testing boundary or leaves detectable hover range.
    pointeroverPointerEventPointer EventsThe pointing device is moved into the hit-testing boundary.
    pointerupPointerEventPointer EventsThe pointer leaves the active button state.
    playEventHTML5 mediaPlayback has begun.
    playingEventHTML5 mediaPlayback is ready to start after having been paused or delayed due to lack of data.
    popstatePopStateEventHTML5A session history entry is being navigated to (in certain cases).
    progressProgressEventProgress and XMLHttpRequestIn progress.
    pushPushEvent This is an experimental API that should not be used in production code.Push APIA Service Worker has received a push message.
    pushsubscriptionchangePushEvent This is an experimental API that should not be used in production code.Push APIA PushSubscription has expired.
    ratechangeEventHTML5 mediaThe playback rate has changed.
    readystatechangeEventHTML5 and XMLHttpRequestThe readyState attribute of a document has changed.
    repeatEventTimeEventSVGA SMIL animation element is repeated.
    resetEventDOM L2, HTML5A form is reset.
    resizeUIEventDOM L3The document view has been resized.
    resourcetimingbufferfullPerformanceResource TimingThe browser's resource timing buffer is full.
    result This is an experimental API that should not be used in production code.SpeechRecognitionEvent This is an experimental API that should not be used in production code.Web Speech APIThe 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 This is an experimental API that should not be used in production code.Web Speech APIA paused utterance is resumed.
    scrollUIEventDOM L3The document view or an element has been scrolled.
    seekedEventHTML5 mediaA seek operation completed.
    seekingEventHTML5 mediaA seek operation began.
    selectUIEventDOM L3Some text is being selected.
    selectstart This is an experimental API that should not be used in production code.EventSelection APIA selection just started.
    selectionchange This is an experimental API that should not be used in production code.EventSelection APIThe selection in the document has been changed.
    showMouseEventHTML5A contextmenu event was fired on (or bubbled to) an element that has a contextmenu attribute
    slotchangeEventDOMThe node contents of a HTMLSlotElement (<slot>) have changed.
    soundend This is an experimental API that should not be used in production code.EventWeb Speech APIAny sound — recognisable speech or not — has stopped being detected.
    soundstart This is an experimental API that should not be used in production code.EventWeb Speech APIAny sound — recognisable speech or not — has been detected.
    speechend This is an experimental API that should not be used in production code.EventWeb Speech APISpeech recognised by the speech recognition service has stopped being detected.
    speechstart This is an experimental API that should not be used in production code.EventWeb Speech APISound that is recognised by the speech recognition service as speech has been detected.
    stalledEventHTML5 mediaThe 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.EventWeb Speech APIThe speech recognition service has begun listening to incoming audio with intent to recognize grammars associated with the current SpeechRecognition.
    startSpeechSynthesisEventWeb Speech APIThe utterance has begun to be spoken.
    storageStorageEventWeb StorageA storage area (localStorage or sessionStorage) has changed.
    submitEventDOM L2, HTML5A form is submitted.
    successEventIndexedDBA request successfully completed.
    suspendEventHTML5 mediaMedia data loading has been suspended.
    SVGAbortSVGEventSVGPage loading has been stopped before the SVG was loaded.
    SVGErrorSVGEventSVGAn error has occurred before the SVG was loaded.
    SVGLoadSVGEventSVGAn SVG document has been loaded and parsed.
    SVGResizeSVGEventSVGAn SVG document is being resized.
    SVGScrollSVGEventSVGAn SVG document is being scrolled.
    SVGUnloadSVGEventSVGAn SVG document has been removed from a window or frame.
    SVGZoomSVGZoomEventSVGAn SVG document is being zoomed.
    timeoutProgressEventXMLHttpRequest
    timeupdateEventHTML5 mediaThe time indicated by the currentTime attribute has been updated.
    touchcancelTouchEventTouch EventsA touch point has been disrupted in an implementation-specific manner (too many touch points, for example).
    touchendTouchEventTouch EventsA touch point is removed from the touch surface.
    touchmoveTouchEventTouch EventsA touch point is moved along the touch surface.
    touchstartTouchEventTouch EventsA touch point is placed on the touch surface.
    transitionendTransitionEvent This is an experimental API that should not be used in production code.CSS TransitionsA CSS transition has completed.
    unloadUIEventDOM L3The document or a dependent resource is being unloaded.
    upgradeneededIndexedDBAn attempt was made to open a database with a version number higher than its current version. A versionchange transaction has been created.
    userproximityUserProximityEvent This is an experimental API that should not be used in production code.Proximity SensorFresh 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.EventWeb Speech APIThe list of SpeechSynthesisVoice objects that would be returned by the SpeechSynthesis.getVoices() method has changed (when the voiceschanged event fires.)
    versionchangeIndexedDBA versionchange transaction completed.
    visibilitychangeEventPage visibilityThe content of a tab has become visible or has been hidden.
    volumechangeEventHTML5 mediaThe volume has changed.
    waitingEventHTML5 mediaPlayback has stopped because of a temporary lack of data.
    wheelWheelEventDOM L3A wheel button of a pointing device is rotated in any direction.

    Non-standard events

    Event NameEvent TypeSpecificationFired when...
    afterscriptexecuteEventMozilla SpecificA script has been executed.
    beforescriptexecuteEventMozilla SpecificA script is about to be executed.
    beforeinstallpromptEventChrome specificA user is prompted to save a website to a home screen on mobile.
    cardstatechangeFirefox OS specificThe MozMobileConnection.cardState property changes value.
    changeDeviceStorageChangeEventFirefox OS specificThis event is triggered each time a file is created, modified, or deleted on a given storage area.
    connectionInfoUpdateFirefox OS specificThe information about the signal strength and the link speed have been updated.
    cfstatechangeFirefox OS specificThe call forwarding state changes.
    datachangeFirefox OS specificThe MozMobileConnection.data object changes values.
    dataerrorFirefox OS specificThe MozMobileConnection.data object receives an error from the RIL.
    DOMMouseScroll This deprecated API should no longer be used, but will probably still work.Mozilla specificThe wheel button of a pointing device is rotated (detail attribute is a number of lines). (use wheel instead)
    dragdrop This deprecated API should no longer be used, but will probably still work.DragEventMozilla specificAn element is dropped (use drop instead).
    dragexit This deprecated API should no longer be used, but will probably still work.DragEventMozilla specificA drag operation is being ended (use dragend instead).
    draggesture This deprecated API should no longer be used, but will probably still work.DragEventMozilla specificThe user starts dragging an element or text selection (use dragstart instead).
    icccardlockerrorFirefox OS specificThe MozMobileConnection.unlockCardLock() or MozMobileConnection.setCardLock() methods fail.
    iccinfochangeFirefox OS specificThe MozMobileConnection.iccInfo object changes.
    localizedMozilla SpecificThe page has been localized using data-l10n-* attributes.
    mousewheel This deprecated API should no longer be used, but will probably still work.IE inventedThe wheel button of a pointing device is rotated.
    MozAudioAvailableEventMozilla specificThe 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 specificA window is about to be resized.
    mozbrowseractivitydoneFirefox OS Browser API-specificSent when some activity has been completed (complete description TBD.)
    mozbrowserasyncscrollFirefox OS Browser API-specificSent when the scroll position within a browser<iframe> changes.
    mozbrowseraudioplaybackchangeFirefox OS Browser API-specificSent when audio starts or stops playing within the browser <iframe> content.
    mozbrowsercaretstatechangedFirefox OS Browser API-specificSent when the text selected inside the browser <iframe> content changes.
    mozbrowsercloseFirefox OS Browser API-specificSent when window.close() is called within a browser <iframe>.
    mozbrowsercontextmenuFirefox OS Browser API-specificSent when a browser <iframe> tries to open a context menu.
    mozbrowserdocumentfirstpaintFirefox OS Browser API-specificSent when a new paint occurs on any document in the browser <iframe>.
    mozbrowsererrorFirefox OS Browser API-specificSent when an error occurred while trying to load a content within a browser <iframe>.
    mozbrowserfindchangeFirefox OS Browser API-specificSent when a search operation is performed on the browser <iframe> content (see HTMLIFrameElement search methods.)
    mozbrowserfirstpaintFirefox OS Browser API-specificSent when the <iframe> paints content for the first time (this doesn't include the initial paint from about:blank.)
    mozbrowsericonchangeFirefox OS Browser API-specificSent when the favicon of a browser <iframe> changes.
    mozbrowserlocationchangeFirefox OS Browser API-specificSent when a browser <iframe>'s location changes.
    mozbrowserloadendFirefox OS Browser API-specificSent when the browser <iframe> has finished loading all its assets.
    mozbrowserloadstartFirefox OS Browser API-specificSent when the browser <iframe> starts to load a new page.
    mozbrowsermanifestchangeFirefox OS Browser API-specificSent when the path to the app manifest changes, in the case of a browser <iframe> with an open web app embedded in it.
    mozbrowsermetachangeFirefox OS Browser API-specificSent when a <meta> element is added to, removed from, or changed in the browser <iframe>'s content.
    mozbrowseropensearchFirefox OS Browser API-specificSent when a link to a search engine is found.
    mozbrowseropentabFirefox OS Browser API-specificSent when a new tab is opened within a browser <iframe> as a result of the user issuing a command to open a link target in a new tab (for example Ctrl/Cmd + click.)
    mozbrowseropenwindowFirefox OS Browser API-specificSent when window.open() is called within a browser iframe.
    mozbrowserresizeFirefox OS Browser API-specificSent when the browser <iframe>'s window size has changed.
    mozbrowserscrollFirefox OS Browser API-specificSent when the browser <iframe> content scrolls.
    mozbrowserscrollareachangedFirefox OS Browser API-specificSent when the available scrolling area in the browser <iframe> changes. This can occur on resize and when the page size changes (while loading for example.)
    mozbrowserscrollviewchangeFirefox OS Browser API-specificSent when asynchronous scrolling (i.e. APCZ) starts or stops.
    mozbrowsersecuritychangeFirefox OS Browser API-specificSent when the SSL state changes within a browser <iframe>.
    mozbrowserselectionstatechanged This deprecated API should no longer be used, but will probably still work.Firefox OS Browser API-specificSent when the text selected inside the browser <iframe> content changes. Note that this is deprecated, and newer implementations use mozbrowsercaretstatechanged instead.
    mozbrowsershowmodalpromptFirefox OS Browser API-specificSent when alert(), confirm() or prompt() are called within a browser <iframe>
    mozbrowsertitlechangeFirefox OS Browser API-specificSent when the document.title changes within a browser iframe.
    mozbrowserusernameandpasswordrequiredFirefox OS Browser API-specificSent when an HTTP authentication is requested.
    mozbrowservisibilitychangeFirefox OS Browser API-specificSent when the visibility state of the current browser iframe <iframe> changes, for example due to a call to setVisible().
    MozGamepadButtonDownTo be specifiedA gamepad button is pressed down.
    MozGamepadButtonUpTo be specifiedA gamepad button is released.
    MozMousePixelScroll This deprecated API should no longer be used, but will probably still work.Mozilla specificThe 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 specificFresh data is available from an orientation sensor (see deviceorientation).
    MozScrolledAreaChangedUIEventMozilla specificThe document view has been scrolled or resized.
    moztimechangeMozilla specificThe time of the device has been changed.
    MozTouchDown This deprecated API should no longer be used, but will probably still work.Mozilla specificA 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 specificA 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 specificA touch point is removed from the touch surface (use touchend instead).
    alertingCallEventTo be specifiedThe correspondent is being alerted (his/her phone is ringing).
    busyCallEventTo be specifiedThe line of the correspondent is busy.
    callschangedCallEventTo be specifiedA call has been added or removed from the list of current calls.
    onconnected connectedCallEventTo be specifiedA call has been connected.
    connectingCallEventTo be specifiedA call is about to connect.
    deliveredSMSEventTo be specifiedAn SMS has been successfully delivered.
    dialingCallEventTo be specifiedThe number of a correspondent has been dialed.
    disabledFirefox OS specificWiFi has been disabled on the device.
    disconnectedCallEventTo be specifiedA call has been disconnected.
    disconnectingCallEventTo be specifiedA call is about to disconnect.
    enabledFirefox OS specificWiFi has been enabled on the device.
    errorCallEventTo be specifiedAn error occurred.
    heldCallEventTo be specifiedA call has been held.
    holdingCallEventTo be specifiedA call is about to be held.
    incomingCallEventTo be specifiedA call is being received.
    receivedSMSEventTo be specifiedAn SMS has been received.
    resumingCallEventTo be specifiedA call is about to resume.
    sentSMSEventTo be specifiedAn SMS has been sent.
    statechangeCallEventTo be specifiedThe state of a call has changed.
    statuschangeFirefox OS specificThe status of the Wifi connection changed.
    overflowUIEventMozilla specificAn 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-insertMozilla specificA smartcard has been inserted.
    smartcard-removeMozilla specificA smartcard has been removed.
    stkcommandFirefox OS specificThe STK Proactive Command is issued from ICC.
    stksessionendFirefox OS specificThe STK Session is terminated by ICC.
    touchenterTouchEventTouch Events Removed
    touchleaveTouchEventTouch Events Removed
    underflowUIEventMozilla specificAn 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.ProgressEventMozilla SpecificUpload is in progress (see progress).

    ussdreceived

    Firefox OS specificA new USSD message is received
    voicechangeFirefox OS specificThe MozMobileConnection.voice object changes values.
    msContentZoomMicrosoft specific
    MSManipulationStateChangedMicrosoft specific
    MSPointerHover This deprecated API should no longer be used, but will probably still work.Microsoft specific

    Mozilla-specific events

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

    XUL events

    Event NameEvent TypeSpecificationFired when...
    broadcastXULAn observer noticed a change to the attributes of a watched broadcaster.
    CheckboxStateChangeXULThe state of a checkbox has been changed either by a user action or by a script (useful for accessibility).
    closeXULThe close button of the window has been clicked.
    commandXULAn element has been activated.
    commandupdateXULA command update occurred on a commandset element.
    DOMMenuItemActiveXULA menu or menuitem has been hovered or highlighted.
    DOMMenuItemInactiveXULA menu or menuitem is no longer hovered or highlighted.
    popuphiddenPopupEventXULA menupopup, panel, or tooltip has been hidden.
    popuphidingPopupEventXULA menupopup, panel, or tooltip is about to be hidden.
    popupshowingPopupEventXULA menupopup, panel, or tooltip is about to become visible.
    popupshownPopupEventXULA menupopup, panel, or tooltip has become visible.
    RadioStateChangeXULThe state of a radio has been changed either by a user action or by a script (useful for accessibility).
    ValueChangeXULThe value of an element has changed (a progress bar, for example; useful for accessibility).

    Add-on-specific events

    Event NameEvent TypeSpecificationFired when...
    MozSwipeGestureAddons specificA touch point is swiped across the touch surface.
    MozMagnifyGestureStartAddons specificTwo touch points start to move away from each other.
    MozMagnifyGestureUpdateAddons specificTwo touch points move away from each other (after a MozMagnifyGestureStart).
    MozMagnifyGestureAddons specificTwo touch points moved away from each other (after a sequence of MozMagnifyGestureUpdate).
    MozRotateGestureStartAddons specificTwo touch points start to rotate around a point.
    MozRotateGestureUpdateAddons specificTwo touch points rotate around a point (after a MozRotateGestureStart).
    MozRotateGestureAddons specificTwo touch points rotate around a point (after a sequence of MozRotateGestureUpdate).
    MozTapGestureAddons specificTwo touch points are tapped on the touch surface.
    MozPressTapGestureAddons specificA "press-tap" gesture happened on the touch surface (first finger down, second finger down, second finger up, first finger up).
    MozEdgeUIGestureAddons specificA touch point is swiped across the touch surface to invoke the Edge UI (Win8 only).
    MozAfterPaintAddons specificContent has been repainted.
    DOMPopupBlockedAddons specificA popup has been blocked.
    DOMWindowCreatedAddons specificA window has been created.
    DOMWindowCloseAddons specificA window is about to be closed.
    DOMTitleChangedAddons specificThe title of a window has changed.
    DOMLinkAddedAddons specificA link has been added a document.
    DOMLinkRemovedAddons specificA link has been removed inside from a document.
    DOMMetaAddedAddons specificA meta element has been added to a document.
    DOMMetaRemovedAddons specificA meta element has been removed from a document.
    DOMWillOpenModalDialogAddons specificA modal dialog is about to open.
    DOMModalDialogClosedAddons specificA modal dialog has been closed.
    DOMAutoCompleteAddons specificThe content of an element has been auto-completed.
    DOMFrameContentLoadedAddons specificThe frame has finished loading (but not its dependent resources).
    AlertActiveAddons specificA notification element is shown.
    AlertCloseAddons specificA notification element is closed.
    fullscreenAddons specificBrowser fullscreen mode has been toggled.
    sizemodechangeAddons specificWindow has entered/left fullscreen mode, or has been minimized/unminimized.
    MozEnteredDomFullscreenAddons specificDOM fullscreen mode has been entered.
    SSWindowClosingAddons specificThe session store will stop tracking this window.
    SSTabClosingAddons specificThe session store will stop tracking this tab.
    SSTabRestoringAddons specificA tab is about to be restored.
    SSTabRestoredAddons specificA tab has been restored.
    SSWindowStateReadyAddons specificA window state has switched to "ready".
    SSWindowStateBusyAddons specificA window state has switched to "busy".
    TabOpenAddons specificA tab has been opened.
    TabCloseAddons specificA tab has been closed.
    TabSelectAddons specificA tab has been selected.
    TabShowAddons specificA tab has been shown.
    TabHideAddons specificA tab has been hidden.
    TabPinnedAddons specificA tab has been pinned.
    TabUnpinnedAddons specificA tab has been unpinned.

    Developer tool-specific events

    Event NameEvent TypeSpecificationFired when...
    CssRuleViewRefresheddevtools specificThe "Rules" view of the style inspector has been updated.
    CssRuleViewChangeddevtools specificThe "Rules" view of the style inspector has been changed.
    CssRuleViewCSSLinkClickeddevtools specificA link to a CSS file has been clicked in the "Rules" view of the style inspector.

    See also

    如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

    扫码二维码加入Web技术交流群

    发布评论

    需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
    列表为空,暂无数据

    词条统计

    浏览:197 次

    字数:227430

    最后编辑:7 年前

    编辑次数:0 次

      我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
      原文