FocusEvent:FocusEvent() 构造函数
>FocusEvent() 构造函数返回一个新创建的 FocusEvent 对象,并可选地指定一个 EventTarget。当事件同时具有源目标和目标目标时,relatedTarget 的值必须设置为另一个目标。
语法
js
new FocusEvent(type)
new FocusEvent(type, options)
参数
FocusEvent() 构造函数还会继承来自 UIEvent() 和 Event() 的参数。
type-
表示事件名称的字符串。它区分大小写,浏览器会将其设置为
blur、focus、focusin或focusout。 options可选-
一个对象。除
UIEvent()中定义的属性外,还可以具有以下属性:-
一个
EventTarget,表示FocusEvent的次要目标。默认值为null。
-
规范
| 规范 |
|---|
| UI Events> # dom-focusevent-focusevent> |
浏览器兼容性
参见
- 它所属的
FocusEvent接口。