Gets the previous sibling of the first selected element optionally filtered by a selector.
$('.orange').prev().hasClass('apple');//=> true
The previous nodes.
https://api.jquery.com/prev/
Optional
If specified filter for siblings.
Gets the previous sibling of the first selected element optionally filtered by a selector.
Example
Returns
The previous nodes.
See
https://api.jquery.com/prev/