event.relatedTarget
The other DOM element involved in the event, if any.
.event.relatedTarget()🡢 Element
For mouseout
, indicates the element being entered; for mouseover
, indicates the element being exited.
On mouseout of anchors, alert the element type being entered.
HTML
$("a").mouseout(function (event) {
alert(event.relatedTarget.nodeName); // "DIV"
});
DEMO