Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/deno/cli/js/event.ts>Event

A modern runtime for JavaScript and TypeScript.
Go to Latest
class Event
implements [domTypes.Event]
import { Event } from "https://deno.land/x/deno@v0.30.0/cli/js/event.ts";

Constructors

new
Event(type: string, eventInitDict?: domTypes.EventInit)

Properties

private
_canceledFlag: boolean
private
_dispatchedFlag: boolean
private
_initializedFlag: boolean
private
_inPassiveListenerFlag: boolean
private
_path: domTypes.EventPath[]
private
_stopImmediatePropagationFlag: boolean
private
_stopPropagationFlag: boolean
readonly
bubbles: boolean
readonly
cancelable: boolean
cancelBubble: boolean
cancelBubbleImmediately: boolean
readonly
composed: boolean
currentTarget: domTypes.EventTarget
readonly
defaultPrevented: boolean
dispatched: boolean
eventPhase: number
readonly
initialized: boolean
writeonly
inPassiveListener: boolean
isTrusted: boolean
path: domTypes.EventPath[]
relatedTarget: domTypes.EventTarget
target: domTypes.EventTarget
readonly
timeStamp: Date
readonly
type: string

Methods

composedPath(): domTypes.EventPath[]

Returns the event’s path (objects on which listeners will be invoked). This does not include nodes in shadow trees if the shadow root was created with its ShadowRoot.mode closed.

 event.composedPath();

Cancels the event (if it is cancelable). See https://dom.spec.whatwg.org/#set-the-canceled-flag

 event.preventDefault();

For this particular event, no other listener will be called. Neither those attached on the same element, nor those attached on elements which will be traversed later (in capture phase, for instance).

 event.stopImmediatePropagation();

Stops the propagation of events further along in the DOM.

 event.stopPropagation();