I have
var $set = $('.foo,.bar').filter(
function() {return $(this).parents('.baz').length < 1;});
as a way to select all the elements whose classes are either foo
or bar
and who do not descend from an element whose class is baz
. Is there a selector that will accomplish the same thing without the need for a filtering lambda?
<div class='foo'/><!--match this-->
<div class='bar'/><!--match this-->
<div class='baz'>
<div class='foo'/> <!--don't match this-->
</div>