1. prev() gets the immediate preceeding sibling of each element in the set of matched elements.2. prev() method searched for the predecessor for each of the matched elements and creates a new jQuery object.

In the above example, we have created an unordered list of players. We have created buttons corresponding to player names in the list. On click of button, corresponding li element is selected and using prev() method, the previous li element is selected and CSS is applied to it.

In the above example, we have created a table. In above example we ask user to enter the index to select the table row. Then on click of prev button, we are changing the CSS of previous row. We have applied required validations as well.