jQuery Tutorial Tutorials - jQuery event.currentTarget

jQuery event.currentTarget

The event.currentTarget property in jQuery refers to the current DOM element within the event bubbling phase.

It's usually equal to the this of the handler function.

jQuery event.currentTarget property Example

example

Alert that currentTarget matches the this keyword and debug the event.currentTarget property.

$( "p" ).click(function( event ) {
  alert( event.currentTarget === this ); // true
  console.log(event.currentTarget);
});

Try now

Date:2019-08-28 10:36:12 From:www.Lautturi.com author:Lautturi