<!DOCTYPE html>
<html lang="en-US">
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> </head>
<body>
<h1>jQuery event.delegateTarget Property</h1>
<div>
<p>This is paragraph inside div.</p>
<button>Click Me</button>
</div>
<div>
<p>This is paragraph inside div.</p>
<button>Click Me</button>
</div>
<script>
$(document).ready(function(){
$("div").on("click", "button", function(e){
$(e.delegateTarget).css("color", "red");
});
});
</script> </body>
</html>