I have this markup:
<div class="foo">
<div class="child"></div>
<div class="child"></div>
<div class="child"></div>
</div>
If I want to attach click to all children I will do:
var foo = $('.foo').on('click', ".child", function(e, data){
//get foo here?
})
When child is clicked how can I get foo here? Disregard the fact that I know here that foo is the parent of clicked child. (not sure closest would work but that would be using selectors again, is there a more direct method?)