event.currentTarget
JQ Home <<
Objects <<
event.currentTarget
Event bubbling phase in progress DOM element property.
Description
The event.currentTarget
Event object property, contains the value of the DOM element in progress within the event bubbling phase.
- This property will generally be equal to the
this
special operator within function scope:- When using some form of scope manipulation such as
jQuery.proxy()
, thethis
special operator will equal the context specified.
- When using some form of scope manipulation such as
Syntax
Signature | Description |
---|---|
event.currentTarget | The value of the DOM element in progress within the event bubbling phase. |
Parameters
None.
Return
A DOM element.
event.currentTarget
Example
Objects << Top
Contains the value of the DOM element in progress within the event bubbling phase.
In the example below when we press the button the first time we do a strict comparison the this
special operator and
event.currentTarget
and output a message.
$(function(){
$('#btn1').one('click', function(event){
$('#scrollspan1').append('Does event.currentTarget === this? '
+ ( event.currentTarget === this ));
});
});
We will show a message here for the mouse button press.
Related Tutorials
jQuery Advanced Tutorials - Lesson 5 - The Event Object