HTML DOM FocusEvent
FocusEvent object
An event occurs when an element gains or loses focus, which belongs to the FocusEvent object.
Focus event properties and methods
Property/Method | Description |
---|---|
relatedTarget | Return the element related to the triggering event. |
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. |