as

Settings
Sign out
Notifications
Alexa
亚马逊应用商店
Ring
AWS
文档
Support
Contact Us
My Cases
新手入门
设计和开发
应用发布
参考
支持
跳转到主要内容
https://dom.spec.whatwg.org/#interface-eventtarget

方法

addEventListener()

addEventListener(type: string, listener: EventListener, options?: boolean | AddEventListenerOptions | undefined): void 添加事件侦听器。

参数

type
string 要侦听的事件。
listener
EventListener 事件处理程序函数。
options?
boolean | AddEventListenerOptions | undefined 忽略。

removeEventListener()

removeEventListener(type: string, listener: EventListener, options?: boolean | EventListenerOptions | undefined): void 移除事件侦听器。

参数

type
string 要侦听的事件。
listener
EventListener 要移除的事件处理程序函数。
options?
boolean | EventListenerOptions | undefined 忽略。

dispatchEvent()

dispatchEvent(event: Event): boolean 向目标分发事件

参数

event
Event 发出事件信号的事件。在实现中添加和定义,暂时将其保留为可选。

返回值

boolean
最后修改于 2026年10月26日