W3cubDocs

/DOM

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 dispatchEvent.

Syntax

var bool = event.isTrusted;

Example

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

Specification

Specification Status Comment
DOM
The definition of 'Event.isTrusted' in that specification.
Living Standard
Document Object Model (DOM) Level 3 Events Specification
The definition of 'Trusted events' in that specification.
Obsolete Adds requirements regarding trusted and untrusted events, though it does not itself define the isTrusted property.

Browser compatibilityUpdate compatibility data on GitHub

Desktop
Chrome Edge Firefox Internet Explorer Opera Safari
Basic support 46
46
Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Yes Yes No
No
In Internet Explorer, all events are trusted except those that are created with the createEvent() method.
33
33
Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
No
Mobile
Android webview Chrome for Android Edge Mobile Firefox for Android Opera for Android iOS Safari Samsung Internet
Basic support 46
46
Starting with version 53, untrusted events do not invoke the default action.
46
46
Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Yes Yes 33
33
Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
No ?

© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/Event/isTrusted