event.currentTarget Property - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:event.currentTarget

jQuery event.currentTarget Property


The event.currentTarget property is the current DOM element in the event bubbling phase, and is typically equal to this.


Parameter Description
event Required. The event parameter comes from the event binding function

The following code shows that event.currentTarget is typically equal to this:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
    $("h1, h2, p").click(function(event){
        console.log(event.currentTarget === this);
    });/*from w w w .ja v  a  2s .  c om*/

<h1>Heading 1 click me</h1>
<h2>Heading 2 click me</h2>


Related Tutorials