Nasi wolontariusze nie przetłumaczyli jeszcze tego artykułu na język Polski. Dołącz do nas i pomóż go przetłumaczyć!
Można także przeczytać artykuł w języku: English (US).

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

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support461 Yes Yes No2331 No
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support461461 Yes Yes331 No ?

1. Starting with Chrome 53 and Opera 40, 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.

Autorzy i etykiety dokumentu

Ostatnia aktualizacja: fscholz,