This version is old school.
Please find jQuery plugins on npm.
.closestDescendant( selector [, findAll ] )
Get the first element(s) that matches the selector by traversing down through descendants in the DOM tree level by level. It use a breadth first search (BFS), that mean it will stop going deeper in a subtree if the first matching descendant was found in the current subtree.