jQuery event.currentTarget property
Example
event.currentTarget usually equals this:
$("h1,h2,p").click(function(event){
alert(event.currentTarget === this);
});
Try it
Definition and Usage
The event.currentTarget property is the current DOM element within the event bubbling phase, usually equal to this.
Syntax
event
.currentTarget
| Parameters | Description |
|---|---|
| event | Required.event The parameters come from the event binding function. |
More examples
Returning the element's content
Use event.currentTarget.innerHTML to return the element's content.
jQuery event methods