Get original element using .on
- by RGraham
When using jQuery's event delegation, is there a way to retrieve the element on which .on was called, as well as the element on which the event was called?
jQuery:
$(".item").on("click","a",function() {
var link = $(this); // a tag
var itemDiv = // what?
});
HTML:
<div class="item">
<a href="#">Link</a>
<a href="#">Link</a>
<a href="#">Link</a>
<a href="#">Link</a>
</div>