Is there a jQuery function that combines the upward-looking closest()
or parents()
and the downward looking children()
function?
For example:
<span id="container">
<div class="a 1"></div>
<div class="b 2"></div>
<div class="c 3">
<div class="d 4"></div>
<div class="b 5"></div>
</div>
<span>
$(".c").something(".b");
should return the 'closest' .b
element, or .2