FocusEvent relatedTarget Property
Get the related element of the element that triggered an onfocus event:
Definition and Usage
The relatedTarget property returns the element related to the element that triggered the focus/blur event.
- For onfocus and onfocusin events, the related element is the element that LOST focus.
- For onblur and onfocusout events, the related element is the element that GOT focus.
This property is read-only.
|Return Value:||A reference to the related element, or null if there is no related element|
|DOM Version:||DOM Level 3 Events|
event.relatedTarget is a DOM Level 3 (2004) feature.
It is fully supported in all modern browsers: