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 click event fired through HTMLElement.click() sets the isTrusted property to false.

Value

A boolean value.

Example

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

Specifications

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

Browser compatibility

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
isTrusted
Chrome – Full support
Chrome 46 (Release date: 2015-10-13)
footnote
footnote Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Edge – Full support
Edge 12 (Release date: 2015-07-29)
footnote Full support
Firefox – Full support
Firefox 1.5 (Release date: 2005-11-29)
footnote Full support
Opera – Full support
Opera 33 (Release date: 2015-10-27)
footnote
footnote Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Safari – Full support
Safari 10 (Release date: 2016-09-20)
footnote Full support
Chrome Android – Full support
Chrome Android 46 (Release date: 2015-10-14)
footnote
footnote Starting with Chrome Android 53 and Opera 40, untrusted events do not invoke the default action.
Firefox for Android – Full support
Firefox for Android 4 (Release date: 2011-03-29)
footnote Full support
Opera Android – Full support
Opera Android 33 (Release date: 2015-11-03)
footnote
footnote Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Safari on iOS – Full support
Safari on iOS 10 (Release date: 2016-09-13)
footnote Full support
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote
footnote Starting with Samsung Internet 6.0 and Opera 40, untrusted events do not invoke the default action.
WebView Android – Full support
WebView Android 46 (Release date: 2015-10-14)
footnote
footnote Starting with version 53, untrusted events do not invoke the default action.
WebView on iOS – Full support
WebView on iOS 10 (Release date: 2016-09-13)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 14.5 (Release date: 2020-06-30)
footnote Full support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
See implementation notes.