My HTML markup is structured similarly to this:
<div id="parentElement">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
I've implemented an event handler for each child element using jQuery:
$( "div.child" ).on( "click", someFunction );
Is there a straightforward method for me to identify which child element was clicked within the event object? For instance, I'd like to be able to determine if the user clicked on the 3rd child <div>
as opposed to one of the other child <div>
.