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