Firefox Tomorrow

web api instance property

FocusEvent: relatedTarget property

View on MDN ↗

The relatedTarget read-only property of the FocusEvent interface is the secondary target, depending on the type of event:

Event name target relatedTarget
[`blur`](/firefox/mdn/api/element/blur_event/) The [`EventTarget`](/firefox/mdn/api/eventtarget/) losing focus The [`EventTarget`](/firefox/mdn/api/eventtarget/) receiving focus (if any).
[`focus`](/firefox/mdn/api/element/focus_event/) The [`EventTarget`](/firefox/mdn/api/eventtarget/) receiving focus The [`EventTarget`](/firefox/mdn/api/eventtarget/) losing focus (if any)
[`focusin`](/firefox/mdn/api/element/focusin_event/) The [`EventTarget`](/firefox/mdn/api/eventtarget/) receiving focus The [`EventTarget`](/firefox/mdn/api/eventtarget/) losing focus (if any)
[`focusout`](/firefox/mdn/api/element/focusout_event/) The [`EventTarget`](/firefox/mdn/api/eventtarget/) losing focus The [`EventTarget`](/firefox/mdn/api/eventtarget/) receiving focus (if any)

Note that many elements can’t have focus, which is a common reason for relatedTarget to be null. relatedTarget may also be set to null for security reasons, like when tabbing in or out of a page.

relatedTarget is a similar property for mouse events.

Value

An instance of EventTarget.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.

See also