Gets all the preceding siblings up to but not including the element matched by the selector, optionally filtered by another selector.
$('.pear').prevUntil('.apple');//=> [<li class="orange">Orange</li>]
The previous nodes.
https://api.jquery.com/prevUntil/
Optional
Selector for element to stop at.
If specified filter for siblings.
Gets all the preceding siblings up to but not including the element matched by the selector, optionally filtered by another selector.
Example
Returns
The previous nodes.
See
https://api.jquery.com/prevUntil/