Home >>jQuery Tutorial >jQuery event.target Property

jQuery event.target Property

jQuery event.target Property

jQuery event.target property in jQuery is used to returns which DOM element triggered the event and useful to compare event.target to this in order to determine if the event is being handled due to event bubbling.


Parameter Values

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

<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
$(".para, .btn1, .head").click(function(event){
$(".box").html("It is Triggered by a " + event.target.nodeName + " element.");
<h1 class="head">This is Phptpoint</h1>
<p class="para">This is first paragraph</p>
<button class="btn1">Click me</button>
<div class="box" style="color:red;"></div>


This is Phptpoint

This is first paragraph