Back

.prev( [selector] )

Get the previous sibling of each element in the current set

If selector is provided, the results will only include siblings that match the selector

Params

selector{Selector} [optional]A selector expression to match elements against

Returns

DollarJS (new set)

Examples

$('p').prev()
$('p').prev('.foo')