event.currentTargetS2C 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
thisspecial operator within function scope:- When using some form of scope manipulation such as
jQuery.proxy(), thethisspecial 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 ExampleTop
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 of 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.