MessageEvent
The MessageEvent
interface represents a message received by a target object.
Properties
The cancelable
read-only property of the Event interface indicates whether the event can be canceled, and therefore prevented as if the event never happened.
The currentTarget
read-only property of the Event interface identifies the element to which the event handler has been attached.
The defaultPrevented
read-only property of the Event interface returns a boolean value indicating whether or not the call to Event.preventDefault() canceled the event.
The eventPhase
read-only property of the being evaluated.
The isTrusted
read-only property of the when the event was generated by the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false
when the event was dispatched via The only exception is the click
event, which initializes the isTrusted
property to false
in user agents.
The lastEventId
read-only property of the unique ID for the event.
The ports
read-only property of the containing all MessagePort objects sent with the message, in order.
The source
read-only property of the a WindowProxy, MessagePort, or a MessageEventSource
(which can be a WindowProxy, message emitter.
The read-only target
property of the dispatched.
The timeStamp
read-only property of the Event interface returns the time (in milliseconds) at which the event was created.
Functions
The composedPath()
method of the Event interface returns the event's path which is an array of the objects on which listeners will be invoked.
The preventDefault()
method of the Event interface tells the user agent that if the event does not get explicitly handled, its default action should not be taken as it normally would be.
The stopImmediatePropagation()
method of the If several listeners are attached to the same element for the same event type, they are called in the order in which they were added.
The stopPropagation()
method of the Event interface prevents further propagation of the current event in the capturing and bubbling phases.