Event.isTrusted - Web APIs 编辑
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 EventTarget.dispatchEvent()
.
Syntax
var eventIsTrusted = event.isTrusted;
Value
Example
if (e.isTrusted) {
/* The event is trusted */
} else {
/* The event is not trusted */
}
Specifications
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
BCD tables only load in the browser
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论