DOM
SourceisTrusted
is a convenience that indicates whether an event is dispatched by the user agent (as opposed to using dispatchEvent()
). The sole legacy exception is click()
, which causes
the user agent to dispatch an event whose isTrusted
attribute is initialized to
false.
In all current engines.
FirefoxYesSafariYesChrome49+ Opera36+Edge79+ Edge (Legacy)12+IEYes Firefox for AndroidYesiOS SafariYesChrome for Android49+Android WebView49+Samsung Internet5.0+Opera Mobile36+ Node.js14.5.0+
The timeStamp
attribute must return the value it was
initialized to.
To initialize an event, with type, bubbles, and cancelable, run these steps:
The initEvent(type, bubbles, cancelable)
method steps are:
initEvent()
is redundant with event constructors and
incapable of setting composed
. It has to be supported for legacy content.
partial interface Window { [Replaceable] readonly attribute (Event or undefined) event; // legacy };
Each Window
object has an associated current event (undefined or an Event
object). Unless stated otherwise it is undefined.
The event
getter steps are to return this’s current event.
Web developers are strongly encouraged to instead rely on the Event
object passed
to event listeners, as that will result in more portable code. This attribute is not available in
workers or worklets, and is inaccurate for events dispatched in shadow trees.
Read Next page