Hi All, I've googled and googled to no avail, this question has too many instances of words like "not" in it and I'm struggling to find anything useful.
I'm doing something quite complex but the crux of the question is this, with a structure like so: <div id="document"> <ul class="menu"> <li><a href="">Menu Link</a></li> <li><a href="">Menu Link</a></li> <li><a href="">Menu Link</a></li> </ul> <p><a href="">Paragraph Link</a></p> <p><a href="">Paragraph Link</a></p> <p><a href="">Paragraph Link</a></p> </div> I want to select all anchor tags but _not_ the ones in the menu. Now I know in the situation above I could just do: $("#document p a").dostuff(); But imagine I have a document where the menu might be mucked about with and the content has all kinds of things going on. What I really want to do is something like: $("#document [any element path that doesn't include .menu] a").dostuff(); I have tried: $("#document a").not(".menu a").dostuff(); $("#document *:not(.menu) a").dostuff(); $("#document a:not(.menu a)").dostuff(); I am at a loss. No doubt there is a really simple way of saying "select all of the elements where none of the parents are the .menu element". Thanks for your help. James