up and down events

up and down events

Web technology reference for developers

Code used to describe document style

Protocol for transmitting web resources

Interfaces for building web applications

Developing extensions for web browsers

Web technology reference for developers

Learn to structure web content with HTML

Learn to make the web accessible to all

Get real-time assistance and support

All browser compatibility updates at a glance

Frequently asked questions about MDN Plus

Get real-time assistance and support

Eventsare fired to notify code of interesting changes that may affect code execution. These can arise from user interactions such as using a mouse or resizing a window, changes in the state of the underlying environment (e.g. low battery or media events from the operating system), and other causes.

Each event is represented by an object that is based on theEventinterface, and may have additional custom fields and/or functions to provide information about what happened. The documentation for every event has a table (near the top) that includes a link to the associated event interface, and other relevant information. A full list of the different event types is given inEvent Interfaces based on Event.

This topic provides an index to the mainsortsof events you might be interested in (animation, clipboard, workers etc.) along with the main classes that implement those sorts of events.

Events related to theWeb Animation API.

Used to respond to changes in animation status (e.g. when an animation starts or ends).

Events related to the fetching data.

Used to notify when content is cut, copied, or pasted.

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.

Provides notification events when CSS transitions start, stop, are cancelled, etc.

Events related to database operations: opening, closing, transactions, errors, etc.

Events related to modifications to the Document Object Model (DOM) hierarchy and nodes.

Warning:Mutation Eventsare deprecated.Mutation Observersshould be used instead.

Events related to using theHTML Drag and Drop APIandwheel 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.

Events related to elements gaining and losing focus.

Events related to forms being constructed, reset and submitted.

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.

Touch eventsare recommended for implementing gestures.

In addition there are a number of non-standard gesture events:

Events related to changing the state of a display or textual element.

Events related to HTML input elements e.g.input,select, ortextarea.

Used to notify when keys are moved up, down, or just pressed.

Events related to loading and unloading documents.

Events related to installation ofprogressive web app manifests.

Events related to media usage (including theMedia Capture and Streams API,Web Audio API,Picture-in-Picture API, etc.).

Events related to a window receiving a message from another browsing context.

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.

Events related to gaining and losing network connection.

Events fired onNetworkInformation(Network Information API).

Events related to thePayment Request API.

Events fired onPaymentRequest,PaymentResponse.

Events related to any performance-related spec grouped intoPerformance APIs.

Events related to thePointer Events API.

Provides hardware-agnostic notification from pointing devices including Mouse, Touch, pen/stylus.

Events sent to the global script context when any JavaScript promise is rejected.

Events related to theWebSockets API.

Events fired onSVGElement,SVGAnimationElement,SVGGraphicsElement.

Selection APIevents related to selecting text.

Event (selectionchange) fired onHTMLTextAreaElement,HTMLInputElement.

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 related to theWebXR Device API.

Warning:TheWebVR API(and associatedWindowevents) are deprecated.

Events related to theserver sent events API.

Events related to theWeb Speech API.

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.

This page was last modified onNov 22, 2024byMDN contributors.

Your blueprint for a better internet.

VisitMozilla Corporationsnot-for-profit parent, theMozilla Foundation.Portions of this content are ©19982024by individual contributors. Content available undera Creative Commons license.

Tags:

No responses yet

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注