HTML DOM FocusEvent
FocusEvent 对象
当元素获得或失去焦点时发生的事件属于 FocusEvent 对象。
Focus事件属性和方法
属性/方法 | Description |
---|---|
relatedTarget | 返回与触发事件的元素相关的元素。 |
Inherited Properties and Methods
FocusEvent inherits all properties and methods from the following objects:
Event Type
These event types belong to the FocusEvent object:
Event | Description |
---|---|
onblur | This event occurs when an element loses focus. |
onfocus | This event occurs when an element gains focus. |
onfocusin | This event occurs when an element is about to gain focus. |
onfocusout | This event occurs when an element is about to lose focus. |