FocusEvent

FocusEvent interface represents focus-related events, including focus , blur , focusin ,和 focusout .

构造函数

FocusEvent()
创建 FocusEvent event with the given parameters.

特性

This interface also inherits properties from its parent UIEvent , and indirectly from Event .

FocusEvent.relatedTarget
Is an EventTarget representing a secondary target for this event. In some cases (such as when tabbing in or out a page), this property may be set to null for security reasons.

方法

This interface has no specific methods. It inherits methods from its parent UIEvent , and indirectly from Event .

规范

规范 状态 Comment
UI Events
The definition of 'FocusEvent' in that specification.
工作草案
Document Object Model (DOM) Level 3 Events Specification
The definition of 'FocusEvent' in that specification.
Obsolete 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
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 12 Firefox 24 IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 24 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
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
relatedTarget
Chrome Yes Edge 12 Firefox 48 IE 9 Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 48 Opera Android Yes Safari iOS Yes Samsung Internet Android Yes

图例

完整支持
完整支持
不支持
不支持
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。

另请参阅