Home >>jQuery Tutorial >jQuery event.currentTarget Property

jQuery event.currentTarget Property

jQuery event.currentTarget Property

jQuery event.currentTarget property in jQuery is used to usually equal to the current DOM element with bubbling process of the event.

Syntax:
event.currentTarget

Parameter Values

Parameter Description
event It is required parameter and is used to the event parameter comes from the event binding function
Here is an Example of jQuery event.currentTarget Property:

<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script>
$(document).ready(function(){
$(".head1, .head2").click(function(event){
alert(event.currentTarget === this);
});  
});
</script>
</head>
<body>
<h1 class="head1">Text Heading 1</h1>
<h2 class="head2">Text Heading 2</h2>
</body>
</html>

Output:

Text Heading 1

Text Heading 2