W3cubDocs

/Web APIs

Event: isTrusted property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨September 2016⁩.

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 the user agent (including via user actions and programmatic methods such as HTMLElement.focus()), and false when the event was dispatched via EventTarget.dispatchEvent(). The only exception is the click event, which initializes the isTrusted property to false in user agents.

Value

A boolean value.

Example

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

Specifications

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Opera Safari Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet WebView Android WebView on iOS
isTrusted
46Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
12 1.5
33Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
10
46Starting with Chrome Android 53 and Opera 40, untrusted events do not invoke the default action.
4
33Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
10
5.0Starting with Samsung Internet 6.0 and Opera 40, untrusted events do not invoke the default action.
46Starting with version 53, untrusted events do not invoke the default action.
10

© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted