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 compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidiOS SafariSamsung Internet
Basic supportChrome Full support 46
Notes
Full support 46
Notes
Notes Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Edge Full support YesFirefox Full support YesIE No support No
Notes
No support No
Notes
Notes In Internet Explorer, all events are trusted except those that are created with the createEvent() method.
Opera Full support 33
Notes
Full support 33
Notes
Notes Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Safari No support NoWebView Android Full support 46
Notes
Full support 46
Notes
Notes Starting with version 53, untrusted events do not invoke the default action.
Chrome Android Full support 46
Notes
Full support 46
Notes
Notes Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Edge Mobile Full support YesFirefox Android Full support YesOpera Android Full support 33
Notes
Full support 33
Notes
Notes Starting with Chrome 53 and Opera 40, untrusted events do not invoke the default action.
Safari iOS No support NoSamsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
See implementation notes.
See implementation notes.

Document Tags and Contributors

Last updated by: fscholz,