Event.isTrusted

The isTrusted read-only property of the Event interface is a Boolean 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().

Syntax

var eventIsTrusted = event.isTrusted;

Value

Boolean

Example

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

Specifications

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

Browser compatibility

BCD tables only load in the browser