Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or cheerio object.
$('.orange').parentsUntil('#food').length;//=> 1
The parents.
https://api.jquery.com/parentsUntil/
Optional
Selector for element to stop at.
Optional filter for parents.
Get the ancestors of each element in the current set of matched elements, up to but not including the element matched by the selector, DOM node, or cheerio object.
Example
Returns
The parents.
See
https://api.jquery.com/parentsUntil/