Please note, this is a STATIC archive of website developer.mozilla.org from November 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

I volontari di MDN non hanno ancora tradotto questo articolo in Italiano. Registrati per tradurlo tu.

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.
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.
Recommendation Initial definition.

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 46.0 [1] (Yes) No support [2] 33 No support
Feature Android Android Webview Firefox Mobile (Gecko) Firefox OS IE Mobile Opera Mobile Safari Mobile Chrome for Android
Basic support ? 46.0 [1] (Yes) ? ? 33 No support 46.0 [1]

[1] Starting with Chrome 53, untrusted events do not invoke the default action. 

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

Tag del documento e collaboratori

 Hanno collaborato alla realizzazione di questa pagina: jpmedley, cvrebert, mrenty, fscholz, kscarfone, teoli, alicebeckett, ziyunfei
 Ultima modifica di: jpmedley,