Back

.parent( [selector] )

Get the parents of each element in the current set

The results will only include direct parents and will not traverse any higher ancestors

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

Params

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

Returns

DollarJS (new set)

Examples

$('p').parent()
$('p').parent('.foo')