I have this basic html structure:
<div class=a>
<div class=m></div>
<div class=m></div>
</div>
<div class=b>
<div class=m></div>
<div class=m></div>
</div>
now I want to iterate over all m, but also would like to know if I am in a or b. using the basic jquery syntax, each of which cannot find this.
$('.m').each(function(index) {
// how do i know if this m is part of a or b ?
});
clamp source
share