W3cubDocs

/Web APIs

Event: isTrusted property

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

Browser compatibility

Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari WebView Android Chrome Android Firefox for Android Opera Android Safari on IOS Samsung Internet
isTrusted
46Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
12 1.5
9In Internet Explorer, all events are trusted except those that are created with the createEvent() method.
33Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
10
46Starting with version 53, untrusted events do not invoke the default action.
46Starting with Chrome 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.

© 2005–2023 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