jQuery API

event.relatedTarget

event.relatedTarget Returns: Element

Description: The other DOM element involved in the event, if any.

  • version added: 1.1.4event.relatedTarget

For mouseout, indicates the element being entered; for mouseover, indicates the element being exited.

Example:

On mouseout of anchors, alert the element type being entered.

$("a").mouseout(function(event) {
  alert(event.relatedTarget.nodeName); // "DIV"
});  

Support and Contributions

Need help with event.relatedTarget or have a question about it? Visit the jQuery Forum or the #jquery channel on irc.freenode.net.

Think you've discovered a jQuery bug related to event.relatedTarget? Report it to the jQuery core team.

Found a problem with this documentation? Report it to the jQuery API team.

* All fields are required