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 this special operator within function scope:
    1. When using some form of scope manipulation such as jQuery.proxy(), the this special operator will equal the context specified.

Syntax

Signature Description
event.currentTargetThe 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 ));
  });
});

Press the button below to action the above code:

We will show a message here for the mouse button press.