Gets all the preceding siblings of the first selected element, optionally filtered by a selector.
$('.pear').prevAll();//=> [<li class="orange">Orange</li>, <li class="apple">Apple</li>]$('.pear').prevAll('.orange');//=> [<li class="orange">Orange</li>]
The previous nodes.
https://api.jquery.com/prevAll/
Optional
If specified filter for siblings.
Gets all the preceding siblings of the first selected element, optionally filtered by a selector.
Example
Returns
The previous nodes.
See
https://api.jquery.com/prevAll/