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
Example
if (e.isTrusted) {
} else {
}
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. |