The MouseEvent.relatedTarget read-only property is the secondary target for the mouse event, if there is one.
That is:
| Event name | target |
relatedTarget |
|---|---|---|
mouseenter |
The EventTarget the pointing device entered to |
The EventTarget the pointing device exited from |
mouseleave |
The EventTarget the pointing device exited from |
The EventTarget the pointing device entered to |
mouseout |
The EventTarget the pointing device exited from |
The EventTarget the pointing device entered to |
mouseover |
The EventTarget the pointing device entered to |
The EventTarget the pointing device exited from |
dragenter |
The EventTarget the pointing device entered to |
The EventTarget the pointing device exited from |
dragleave |
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.