event.currentTarget

event.currentTarget

event.currentTargetReturns: Element

Description: The current DOM element within the event bubbling phase.

  • version added: 1.3event.currentTarget

This property will typically be equal to the this of the function.

If you are using jQuery.proxy or another form of scope manipulation, this will be equal to whatever context you have provided, not event.currentTarget

Example:

Alert that currentTarget matches the `this` keyword.

$( "p" ).click(function( event ) {
  alert( event.currentTarget === this ); // true
});

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

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部