jQuery | event.delegateTarget Property
The event.delegateTarget property in jQuery is used to return the element where the currently-called jQuery event handler was attached.
Syntax:
event.delegateTarget
Parameter:
- event: It is a required parameter and this event parameter comes from the event binding function.
Example:
<!DOCTYPE html> <html> <head> <title> jQuery event.currentTarget Property </title> <script src= </script> <script> $(document).ready(function() { $("div").on("click", "button", function(event) { $(event.delegateTarget).css( "background-color", "green"); }); }); </script> </head> <body> <center> <div> <h1>GeeksForGeeks</h1> <h2 id="geeks2"> jQuery event.currentTarget Property </h2> <button>Click</button> </div> </center> </body> </html> |
chevron_right
filter_none
Output:
Before click:

After click:

Recommended Posts:
- jQuery | jQuery.fx.interval Property with example
- jQuery | jQuery.support Property
- jQuery | jquery Property
- jQuery | jQuery.fx.off Property
- jQuery | length property
- jQuery | context Property
- jQuery | event.currentTarget Property
- jQuery | event.data Property
- jQuery | event.relatedTarget Property with Example
- jQuery | event.which property with Examples
- jQuery | event.timeStamp property with Example
- jQuery | event.namespace Property
- Get the numeric part of CSS property using jQuery
- jQuery | event.target Property with Example
- jQuery | event.type property with Examples
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



