Using a jQuery selector, is it possible to select all elements that are not a descendant of the elements from another selector.
For example, I would like to select all the a
tags that are not a descendant of a th
tag. The only way I can see to do it right now is as follows:
$('a').filter(function () {
return $(this).closest('th').size() == 0
})