FocusEvent.relatedTarget
read-only property is the secondary target, depending on the type of event:
| Event name |
target
|
relatedTarget
|
|---|---|---|
blur
|
EventTarget
losing focus
|
EventTarget
receiving focus (if any).
|
focus
|
EventTarget
receiving focus
|
EventTarget
losing focus (if any)
|
focusin
|
EventTarget
receiving focus
|
EventTarget
losing focus (if any)
|
focusout
|
EventTarget
losing focus
|
EventTarget
receiving focus (if any)
|
注意,
many elements can't have focus
, which is a common reason for
relatedTarget
到
null
.
relatedTarget
may also be set to
null
for security reasons, like when tabbing in or out of a page.
MouseEvent.relatedTarget
is a similar property for mouse events.
secondTarget = focusEvent.relatedTarget
| 规范 | 状态 | 注释 |
|---|---|---|
|
UI Events
The definition of 'FocusEvent.relatedTarget' in that specification. |
工作草案 | |
|
DOM (文档对象模型) 3 级事件规范
The definition of 'FocusEvent.relatedTarget' in that specification. |
过时 | 初始定义。 |
| 桌面 | 移动 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
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 |
完整支持
实验。期望将来行为有所改变。
FocusEvent
interface it belongs to.
FocusEvent
relatedTarget
FocusEvent
relatedTarget