FocusEvent() constructor returns a newly created FocusEvent object with an optional EventTarget . When the event has both a source and a destination, the relatedTarget value must be set to the other target.

句法

var focusEvent = new FocusEvent(typeArg[, focusEventInit]);
					

特性

FocusEvent() constructor also inherits arguments from UIEvent() 和来自 Event() .

typeArg
DOMString 表示事件的名称。
focusEventInit 可选
FocusEventInit 字典,拥有以下字段:

FocusEventInit 字典还接受字段来自 UIEventInit and EventInit 字典。

规范

规范 状态 注释
DOM (文档对象模型) 3 级事件规范
The definition of 'FocusEvent()' in that specification.
过时 初始定义

浏览器兼容性

The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request. 更新 GitHub 上的兼容性数据
桌面 移动
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
FocusEvent() 构造函数 Chrome Yes Edge ≤18 Firefox 24 IE No Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 24 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持

完整支持

不支持

不支持

实验。期望将来行为有所改变。

实验。期望将来行为有所改变。

另请参阅

元数据

  • 最后修改: