event.relatedTarget

event.relatedTarget

event.relatedTargetReturns: 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"
});

© The jQuery Foundation and other contributors
Licensed under the MIT License.
https://api.jquery.com/event.relatedTarget

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部