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.

SyntaxEdit

var bool = event.isTrusted;

ExampleEdit

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

SpecificationEdit

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.
Working Draft Adds requirements regarding trusted and untrusted events, though it does not itself define the isTrusted property.
DOM4
The definition of 'Event.isTrusted' in that specification.
Working Draft Initial definition.

Browser compatibilityEdit

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 46.0 (Yes) No support [1] 33 No support

[1] In Internet Explorer, all events are trusted except those that are created with the createEvent() method.

Document Tags and Contributors

 Contributors to this page: cvrebert, mrenty, jpmedley, fscholz, kscarfone, teoli, alicebeckett, ziyunfei
 Last updated by: cvrebert,