Event Object
The relatedTarget event attribute returns the element related to the element that triggered the event.
This attribute can be used with the mouseover event to indicate the element the cursor just exited, or with the mouseout event to indicate the element the cursor just entered.
The following example returns the element the cursor just exited:
Event Object
Your message has been sent to W3Schools.