Interface Event

An event which takes place in the DOM.

interface Event {
    bubbles: boolean;
    cancelable: boolean;
    cancelBubble: Object;
    composed: boolean;
    currentTarget: EventTarget;
    defaultPrevented: boolean;
    eventPhase: 0 | 2;
    isTrusted: boolean;
    returnValue: boolean;
    srcElement: EventTarget;
    target: EventTarget;
    timeStamp: number;
    type: string;
    composedPath(): [EventTarget?];
    preventDefault(): void;
    stopImmediatePropagation(): void;
    stopPropagation(): void;
}

Hierarchy

  • __Event
    • Event

Properties

bubbles: boolean

This is not used in Node.js and is provided purely for completeness.

cancelable: boolean

True if the event was created with the cancelable option

cancelBubble: Object

Alias for event.stopPropagation(). This is not used in Node.js and is provided purely for completeness.

composed: boolean

This is not used in Node.js and is provided purely for completeness.

currentTarget: EventTarget

Alias for event.target.

defaultPrevented: boolean

Is true if cancelable is true and event.preventDefault() has been called.

eventPhase: 0 | 2

This is not used in Node.js and is provided purely for completeness.

isTrusted: boolean

The AbortSignal "abort" event is emitted with isTrusted set to true. The value is false in all other cases.

returnValue: boolean

This is not used in Node.js and is provided purely for completeness.

srcElement: EventTarget

Alias for event.target.

target: EventTarget

The EventTarget dispatching the event

timeStamp: number

The millisecond timestamp when the Event object was created.

type: string

Returns the type of event, e.g. "click", "hashchange", or "submit".

Methods

  • Returns an array containing the current EventTarget as the only entry or empty if the event is not being dispatched. This is not used in Node.js and is provided purely for completeness.

    Returns [EventTarget?]

  • Sets the defaultPrevented property to true if cancelable is true.

    Returns void

  • Stops the invocation of event listeners after the current one completes.

    Returns void

  • This is not used in Node.js and is provided purely for completeness.

    Returns void