I want to select elements, but not if one of their ancestor matches a certain selector.
For example, let's say I want to match all nodes that are not descendants of a table.
I tried something like this:
$("a", ":not(table *)");
but that crashes my browser.
This one also hangs my browser:
jQuery("a", ":not(table td)");
The page queried is quite large, with lots of very large tables. So, I need something that performs well too. Any ideas?