relatedTarget property

EventTarget? get relatedTarget

The MouseEvent.relatedTarget read-only property is the secondary target for the mouse event, if there is one.

That is:

Event name target relatedTarget
[Element.mouseenter_event] The [EventTarget] the pointing device entered to The [EventTarget] the pointing device exited from
[Element.mouseleave_event] The [EventTarget] the pointing device exited from The [EventTarget] the pointing device entered to
[Element.mouseout_event] The [EventTarget] the pointing device exited from The [EventTarget] the pointing device entered to
[Element.mouseover_event] The [EventTarget] the pointing device entered to The [EventTarget] the pointing device exited from
[HTMLElement.dragenter_event] The [EventTarget] the pointing device entered to The [EventTarget] the pointing device exited from
[HTMLElement.dragleave_event] The [EventTarget] the pointing device exited from The [EventTarget] the pointing device entered to

For events with no secondary target, relatedTarget returns null.

FocusEvent.relatedTarget is a similar property for focus events.

Implementation

external EventTarget? get relatedTarget;