Doing a simple
$('.sel .complex > .nested ~ .element').length is just too good.
But just to use those we won't need to pull in jQuery.
We can simply alias this function to
$ and tweak it a bit.
Personally I always thought it's an odd thing to get all matching elements back and not just one.
The browser compatibility is pretty great for this solution as well.
Just as always, the IE in version 8 and below doesn't exactly play ball and only supports CSS 2.1 selectors and four CSS3 ones.
But who supports IE8 anymore? Poor souls...