I need to select the children nodes of elements where at least one child element does not have a specific property.
e.g. given this html
<div class="x" id="p1">
<div class="a" id="c1"></div>
<div class="a" id="c2"></div>
<div class="b" id="c3"></div>
</div>
<div class="x" id="p2">
<div class="a" id="c4"></div>
<div class="a" id="c5"></div>
<div class="c" id="c6"></div>
</div>
I would like to select all the children of #div2 (i.e. #c4, #c5, #c6) because #div2 does not contain a child with class b applied to it.
or alternatively the reverse selection would suite my needs. i.e. to select all the children of any element where at least one child does have class b applied to it (#c1, #c2, #c3 in the above example)
For this latter example I tried using .b~*
but this only selects nodes after the one with class b applied, not those before.
I'm not sure if this is possible in CSS. If it is 100% not possible then that is an acceptable answer, I'll have to do it in JQuery instead (though I would prefer to avoid it if possible)