Expand description
A module containing JavaScript DOM events.
Structs§
- The
AuxClickEvent
event is fired when a non-primary pointing device button (e.g. any non-left mouse button) has been pressed and released on an element. - The
BeforeUnload
event fires when the window is about to be unloaded (to close the page or follow a link). If the event propagation is cancelled, the browser will present the user with a confirmation dialog allowing them to stay on the page or continue. - The
BlurEvent
is fired when an element has lost focus. The main difference between this event and focusout is that only the latter bubbles. - The
ChangeEvent
is fired for input, select, and textarea elements when a change to the element’s value is committed by the user. Unlike the input event, the change event is not necessarily fired for each change to an element’s value. - The
ClickEvent
is fired when a pointing device button (usually a mouse’s primary button) is pressed and released on a single element. - The
ContextMenuEvent
event is fired when the right button of the mouse is clicked (before the context menu is displayed), or when the context menu key is pressed. - The DataTransfer object is used to hold the data that is being dragged during a drag and drop operation.
- The DataTransferItem object represents one drag data item. During a drag operation, each drag event has a dataTransfer property which contains a list of drag data items. Each item in the list is a DataTransferItem object.
- The DataTransferItemList object is a list of DataTransferItem objects representing items being dragged. During a drag operation, each DragEvent has a dataTransfer property and that property is a DataTransferItemList.
- The
DoubleClickEvent
is fired when a pointing device button (usually a mouse’s primary button) is clicked twice on a single element. - The drop event is fired when an element or text selection is dropped on a valid drop target.
- The dragend event is fired when a drag operation is being ended (by releasing a mouse button or hitting the escape key).
- The dragenter event is fired when a dragged element or text selection enters a valid drop target.
- The drag event is fired every few hundred milliseconds as an element or text selection is being dragged by the user.
- The dragexit event is fired when an element is no longer the drag operation’s immediate selection target.
- The dragleave event is fired when a dragged element or text selection leaves a valid drop target.
- The dragover event is fired when an element or text selection is being dragged over a valid drop target (every few hundred milliseconds).
- A reference to a JavaScript object which implements the IDragEvent interface.
- The dragstart event is fired when the user starts dragging an element or text selection.
- The
FocusEvent
is fired when an element has received focus. The main difference between this event and focusin is that only the latter bubbles. - The ‘FullscreenChange’ event fires when an element enters or exits fullscreen
- The
GamepadConnected
event is fired on the window object, when the first input is received for a gamepad. - The
GamepadDisconnected
event is fired on the window object, when a gamepad is disconnected. - The
GotPointerCaptureEvent
fires when an element receives pointer capture - The
HashChangeEvent
is fired when the fragment identifier of the URL has changed (the part of the URL that follows the # symbol, including the # symbol). - The
InputEvent
is fired synchronously when the value of an input, select, or textarea element is changed. For input elements with type=checkbox or type=radio, the input event should fire when a user toggles the control (via touch, mouse or keyboard) per the HTML5 specification, but historically, this has not been the case. Check compatibility, or attach to the change event instead for elements of these types. - The
KeyDownEvent
is fired when a key is pressed down. Unlike theKeyPressEvent
event it’s also fired for keys which do not produce a character value. - The
KeyPressEvent
is fired when a key is pressed down. It’s only fired for keys which produce a character value. - The
KeyUpEvent
is fired when a key is released. - The
LoadEndEvent
is fired when progress has stopped, e.g. afterProgressErrorEvent
,ProgressAbortEvent
orProgressLoadEvent
have been dispatched. - The
LoadStartEvent
is fired when progress has begun. - The
LostPointerCaptureEvent
fires when an element loses pointer capture - Represents the state of mouse buttons in a
MouseEvent
. - The
MouseDownEvent
is fired when a pointing device button is pressed on an element. - The
MouseEnterEvent
is fired when a pointing device (usually a mouse) is moved over the element that has the listener attached. - The
MouseLeaveEvent
is fired when a pointing device (usually a mouse) is moved out of an element that has the listener attached to it. - The
MouseMoveEvent
is fired when a pointing device (usually a mouse) is moved while over an element. - The
MouseOutEvent
is fired when a pointing device (usually a mouse) is moved off the element that has the listener attached or off one of its children. - The
MouseOverEvent
is fired when a pointing device (usually a mouse) is moved onto the element that has the listener attached or onto one of its children. - The
MouseUpEvent
is fired when a pointing device button is released over an element. - The
MouseWheelEvent
is fired when a pointing device’s wheel button (usually a mousewheel) is rotated over the element that has the listener attached. - The
PointerCancelEvent
is fired when a pointer will no longer produce events (for example the device is deactivated), or if the pointer starts a gesture after a pointerdown event (for example panning, zooming, or drag and drop) - The
PointerDownEvent
is fired when a pointer becomes active - The
PointerEnterEvent
is fired when a pointing device is moved into the hit test boundaries of an element or its descendants. This event does not bubble. - The
PointerLeaveEvent
is fired when the pointer moves out of the hit test boundaries of an element and it’s descendants. This can include when a finger leaves a touch screen or a pen leaves the detectable hover range. This event does not bubble. - The
PointerLockChangeEvent
fires when the pointer is locked or unlocked - The
PointerLockErrorEvent
fires when an error occurs locking a pointer - The
PointerMoveEvent
is fired when a pointer changes coordinates - The
PointerOutEvent
is fired when the pointer moves out of the hit test boundaries of an element. This can include when a finger leaves a touch screen or a pen leaves the detectable hover range. - The
PointerOverEvent
is fired when a pointing device is moved into a element’s hit test boundaries. - The
PointerUpEvent
is fired when a pointer is no longer active - A
PopStateEvent
is dispatched to the window every time the active history entry changes between two history entries for the same document. If the history entry being activated was created by a call tohistory.push_state()
or was affected by a call tohistory.replace_state()
, thePopStateEvent
’s state property contains a copy of the history entry’s state object. - The
ProgressAbortEvent
is fired when the progress has been aborted. - The
ProgressErrorEvent
is fired when the progress has failed. - The
ProgressEvent
is fired to indicate that an operation is in progress. - The
ProgressLoadEvent
is fired when progress has successful finished. - The readystatechange event is fired when the readyState attribute of a document has changed.
- The resize event is fired when the document view has been resized.
- The
ResourceAbortEvent
is fired when the loading of a resource has been aborted. - The
ResourceErrorEvent
is fired when an error occurred; the exact circumstances vary, since this event is used from a variety of APIs. - The
ResourceLoadEvent
is fired when a resource and its dependent resources have finished loading. - The scroll event is fired when the document view or an element has been scrolled.
- The selectionchange event of the Selection API is fired when the current text selection on a document is changed.
- The
slotchange
event is fired on an HTMLSlotElement instance (<slot>
element) when the node(s) contained in that slot change. - A SocketCloseEvent is sent to clients using WebSockets when the connection is closed.
- The error event is fired when an error occurred; the exact circumstances vary, events by this name are used from a variety of APIs.
- A message event informs a WebSocket object that a message has been received.
- An open event informs the target that a data connection, has been established.
- The submit event is fired when a form is submitted.
- The
TouchCancel
event is fired when one or more touch points have been disrupted in an implementation-specific manner (for example, too many touch points are created). - The
TouchEnd
event is fired when one or more touch points are removed from the touch surface. - The
TouchEnter
event is fired when a touch point is moved onto the interactive area of an element. - A reference to a JavaScript object which implements the ITouchEvent interface.
- The
TouchLeave
event is fired when a touch point is moved off the interactive area of an element. - The
TouchMove
is fired when one or more touch points are moved along the touch surface. - The
TouchStart
event is fired when one or more touch points are placed on the touch surface. - The
Unload
event fires when the window has been unloaded and is no longer visible. This event can’t be cancelled.
Enums§
- The kind of drag data item, string or file.
- A DOMString representing the drag operation effect.
- A DOMString representing the drag operation that is allowed.
- Indicates the phase of event flow during event proessing.
- The location on the keyboard of a key.
- A modifier key on the keyboard.
- Represents buttons on a mouse during mouse events.
- What unit of measure the mouse wheel delta is in
- Represents the types of data which can be received on a web socket. Messages are transmitted tagged as either binary or text: text messages are always received as strings. Binary messages may be received as either blobs or array buffers as preferred by the receiver. This choice is indicated via the
binary_type
field on the web socket.
Traits§
- A trait representing a concrete event type.
- The DragEvent interface is a DOM event that represents a drag and drop interaction. The user initiates a drag by placing a pointer device (such as a mouse) on the touch surface and then dragging the pointer to a new location (such as another DOM element).
- The
IEvent
interface represents any event which takes place in the DOM; some are user-generated (such as mouse or keyboard events), while others are generated by APIs (such as events that indicate an animation has finished running, a video has been paused, and so forth). There are many types of event, some of which use other interfaces based on the mainIEvent
interface.IEvent
itself contains the properties and methods which are common to all events. - The
IFocusEvent
interface represents focus-related events. - A GamepadEvent is fired on the window object, when a gamepad is connected or disconnected to the system.
IKeyboardEvent
objects describe a user interaction with the keyboard. Each event describes a key; the event type identifies what kind of activity was performed.- The MessageEvent interface represents a message received by a target object.
- The
IMouseEvent
interface represents events that occur due to the user interacting with a pointing device (such as a mouse). - The
IPointerEvent
interface represents the state of a DOM event produced by a pointer such as the geometry of the contact point, the device type that generated the event, the amount of pressure that was applied on the contact surface, etc. - The
IProgressEvent
interface represents progress-related events. - The
ITouchEvent
interface represents events that occur due to the user interacting with a touch device (such as a phone). - The
IUiEvent
interface represents simple user interface events.