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

  <div id="interfaceDiagram" style="display: inline-block; position: relative; width: 100%; padding-bottom: 11.666666666666666%; vertical-align: middle; overflow: hidden;"><svg style="display: inline-block; position: absolute; top: 0; left: 0;" viewbox="-50 0 600 70" preserveAspectRatio="xMinYMin meet"><a xlink:href="../API/Event" target="_top"><rect x="1" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text  x="38.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">Event</text></a><polyline points="76,25  86,20  86,30  76,25" stroke="#D4DDE4" fill="none"/><line x1="86" y1="25" x2="116" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/UIEvent" target="_top"><rect x="116" y="1" width="75" height="50" fill="#fff" stroke="#D4DDE4" stroke-width="2px" /><text  x="153.5" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">UIEvent</text></a><polyline points="191,25  201,20  201,30  191,25" stroke="#D4DDE4" fill="none"/><line x1="201" y1="25" x2="231" y2="25" stroke="#D4DDE4"/><a xlink:href="../API/FocusEvent" target="_top"><rect x="231" y="1" width="100" height="50" fill="#F4F7F8" stroke="#D4DDE4" stroke-width="2px" /><text  x="281" y="30" font-size="12px" font-family="Consolas,Monaco,Andale Mono,monospace" fill="#4D4E53" text-anchor="middle" alignment-baseline="middle">FocusEvent</text></a></svg></div>
					
  a:hover text { fill: #0095DD; pointer-events: all;}
					

构造函数

FocusEvent()
创建 FocusEvent 事件采用给定参数。

特性

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

FocusEvent.relatedTarget
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 事件 .

规范

规范 状态 注释
UI Events
The definition of 'FocusEvent' in that specification.
工作草案
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 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

图例

完整支持

完整支持

不支持

不支持

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

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

另请参阅

元数据

  • 最后修改: