Given this HTML:
<div class="foo">
select this
<div class="foo">don't select this</div>
</div>
<div class="foo">
select this
</div>
What would be the selector to grab just the divs on the first level, not the nested one?
So the query $('.foo WHATEVER').length should return 2.
See the jsfiddle here.
Maybe something like this? Where foo is not a descendant?
http://jsfiddle.net/DmDBV/