Firefox Tomorrow

web api instance property

Event: isTrusted property

View on MDN ↗

Available in workers

The isTrusted read-only property of the Event interface is a boolean value that is true when the event was generated by the user agent (including via user actions and programmatic methods such as focus()), and false when the event was dispatched via dispatchEvent(). The click event fired through click() sets the isTrusted property to false.

Value

A boolean value.

Example

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

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.