Jquery: get ancestors (or descendants) and self
You can do this: matchedset.find(‘*’).andSelf().filter(selector); For parents: matchedset.parents(‘*’).andSelf().filter(selector);
You can do this: matchedset.find(‘*’).andSelf().filter(selector); For parents: matchedset.parents(‘*’).andSelf().filter(selector);