Is there a function similar to jQuery .closest() but for traversing descendants and returning only closest ones?
I know that there is
If by "closest" descendant you mean the first child then you can do:
$('#foo').find(':first');
Or:
$('#foo').children().first();
Or, to look for the first occurrence of a specific element, you could do:
$('#foo').find('.whatever').first();
Or:
$('#foo').find('.whatever:first');
Really though, we need a solid definition of what "closest descendant" means.
E.g.
Which would $('#foo').closestDescendent('span') return?