English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

jQuery event.currentTarget Property

jQuery Events

The event.currentTarget property is the current DOM element within the event bubbling phase, usually equal to this.

Syntax:

event.currentTarget

Instance

Alert that currentTarget matches the this keyword:

$("p, div, :header").click(function(event){
  alert(event.currentTarget === this);
});
Test and see‹/›

Return the content of the element:

$("p, div, :header").click(function(event){
  alert(event.currentTarget.textContent);
});
Test and see‹/›

Parameter Value

ParameterDescription
eventTheEventParameters come from the event binding feature

jQuery Events