jQuery prev() Method
jQuery prev() Method
The prev() method returns the previous sibling element of the selected element. Sibling elements are those elements that have the same parent. It traverses backward along with previous sibling DOM elements.
Methods related to it are prevAll() and prevUntil().
Syntax:-
Its syntax is:- $(selector).prev(filter)
Further Explanation:-
Parameter | Description |
---|---|
filter | Optional. Specifies a selector expression to narrow down the previous sibling search |