Event reference | MDN (original) (raw)

Event type Description Documentation
Animation Events related to theWeb Animation API. Used to respond to changes in animation status (e.g., when an animation starts or ends). Animation events fired onDocument,Window,HTMLElement.
Asynchronous data fetching Events related to the fetching data. Events fired onAbortSignal,XMLHttpRequest,FileReader.
Clipboard Events related to theClipboard API. Used to notify when content is cut, copied, or pasted. Events fired onDocument,Element,Window.
Composition Events related to composition; entering text "indirectly" (rather than using normal keyboard presses). For example, text entered via a speech to text engine, or using special key combinations that modify keyboard presses to represent new characters in another language. Events fired onElement.
CSS transition Events related toCSS Transitions. Provides notification events when CSS transitions start, stop, are cancelled, etc. Events fired onDocument,HTMLElement,Window.
Database Events related to database operations: opening, closing, transactions, errors, etc. Events fired onIDBDatabase,IDBOpenDBRequest,IDBRequest,IDBTransaction.
DOM mutation Events related to modifications to the Document Object Model (DOM) hierarchy and nodes. Warning: Mutation Events are deprecated.Mutation Observers should be used instead.
Drag'n'drop, Wheel Events related to using theHTML Drag and Drop API and wheel events. Drag and Wheel events are derived from mouse events. While they are fired when using mouse wheel or drag/drop, they may also be used with other appropriate hardware. Drag events fired onDocument Wheel events fired onElement
Focus Events related to elements gaining and losing focus. Events fired onElement,Window.
Form Events related to forms being constructed, reset and submitted. Events fired onHTMLFormElement.
Fullscreen Events related to theFullscreen API. Used to notify when the transitioning between full screen and windowed modes, and also of errors occurring during this transition. Events fired onDocument,Element.
Gamepad Events related to theGamepad API. Events fired onWindow.
Gestures Touch events are recommended for implementing gestures. Events fired onDocument,Element. In addition there are a number of non-standard gesture events: Non-standard WebKit specific events onElement:gesturestart event,gesturechange event,gestureend event.
History Events related to theHistory API. Events fired onWindow.
HTML element content display management Events related to changing the state of a display or textual element. Events fired onHTMLDetailsElement,HTMLDialogElement,HTMLSlotElement.
Inputs Events related to HTML input elements e.g., , or. Events fired onHTMLElement,HTMLInputElement.
Keyboard Events related to using akeyboard. Used to notify when keys are moved up, down, or just pressed. Events fired onDocument,Element.
Loading/unloading documents Events related to loading and unloading documents. Events fired onDocument andWindow.
Manifests Events related to installation ofprogressive web app manifests. Events fired onWindow.
Media Events related to media usage (including theMedia Capture and Streams API,Web Audio API,Picture-in-Picture API, etc.). Events fired onScriptProcessorNode,HTMLMediaElement,AudioTrackList,AudioScheduledSourceNode,MediaRecorder,MediaStream,MediaStreamTrack,VideoTrackList,HTMLTrackElement,OfflineAudioContext,TextTrack,TextTrackList,Element/audio,Element/video.
Messaging Events related to a window receiving a message from another browsing context. Events fired onWindow.
Mouse Events related to using acomputer mouse. Used to notify when the mouse is clicked, double-clicked, up and down events, right-click, movement in and out of an element, text selection, etc. Pointer events provide a hardware-agnostic alternative to mouse events. Drag and Wheel events are derived from mouse events. Mouse events fired onElement
Network/Connection Events related to gaining and losing network connection. Events fired onWindow. Events fired onNetworkInformation (Network Information API).
Payments Events related to thePayment Request API. Events fired onPaymentRequest,PaymentResponse.
Performance Events related to any performance-related spec grouped intoPerformance APIs. Events fired onPerformance.
Pointer Events related to thePointer Events API. Provides hardware-agnostic notification from pointing devices including Mouse, Touch, pen/stylus. Events fired onDocument,HTMLElement.
Print Events related to printing. Events fired onWindow.
Promise rejection Events sent to the global script context when any JavaScript promise is rejected. Events fired onWindow.
Sockets Events related to theWebSockets API. Events fired onWebSocket.
SVG Events related to SVG images. Events fired onSVGElement,SVGAnimationElement,SVGGraphicsElement.
Text selection Selection API events related to selecting text. Event (selectionchange) fired onHTMLTextAreaElement,HTMLInputElement.
Touch Events related to theTouch Events API. Provides notification events from interacting with a touch sensitive screen (i.e., using a finger or stylus). Not related to theForce Touch API. Events fired onDocument,Element.
Virtual reality Events related to theWebXR Device API. Warning: TheWebVR API (and associatedWindow events) are deprecated. Events fired onXRSystem,XRSession,XRReferenceSpace.
RTC (real time communication) Events related to theWebRTC API. Events fired onRTCDataChannel,RTCDTMFSender,RTCIceTransport,RTCPeerConnection.
Server-sent events Events related to theserver sent events API. Events fired onEventSource.
Speech Events related to theWeb Speech API. Events fired onSpeechSynthesisUtterance.
Workers Events related to theWeb Workers API,Service Worker API,Broadcast Channel API, andChannel Messaging API. Used to respond to new messages and message sending errors. Service workers can also be notified of other events, including push notifications, users clicking on displayed notifications, that push subscription has been invalidated, deletion of items from the content index, etc. Events fired onServiceWorkerGlobalScope,DedicatedWorkerGlobalScope,SharedWorkerGlobalScope,WorkerGlobalScope,Worker,BroadcastChannel,MessagePort.