One can use matchedset.find(selector)
/ matchedset.parents(selector)
to get the descendants/ancestors of the current matched set filtered by a selector, but that doesn't include the matched set itself (if it happens to match the selector too). Is there a better (more concise and/or faster) way to get it than
matchedset.find(selector).add(matchedset.filter(selector))
and the respective for parents() ?
You can do this:
matchedset.find('*').andSelf().filter(selector);
For parents:
matchedset.parents('*').andSelf().filter(selector);