Event: isTrusted property

Note: This feature is available in Web Workers.

The isTrusted read-only property of the Event interface is a boolean value that is true when the event was generated by a user action, and false when the event was created or modified by a script or dispatched via EventTarget.dispatchEvent().

Value

A boolean value.

Example

js
if (e.isTrusted) {
  /* The event is trusted */
} else {
  /* The event is not trusted */
}

Specifications

Specification
DOM Standard
# ref-for-dom-event-istrusted①

Browser compatibility

desktopmobileserver
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
Deno
Node.js
isTrusted