HTML DOM FocusEvent

FocusEvent object

Events that occur when an element gains or loses focus are of the FocusEvent object.

Focus event attributes and methods

Attribute/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:

UiEvent

Event Object

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.