Is there a function similar to jQuery .closest() but for traversing descendants and returning only closest ones?
jQuery
.closest()
I know that there is
I would use the following to include the target itself if it matches the selector:
var jTarget = $("#doo"); var sel = '.pou'; var jDom = jTarget.find(sel).addBack(sel).first();
Markup:
poo foo pooo