Get the parent of each element in the current set of matched elements.
// <div class="wrap"><button>Hi</button></div>
$('button').parent().addClass('found');
<div class="wrap found">...</div>
// <div class="active"><span>A</span></div>
// <div><span>B</span></div>
$('span').parent('.active');
// Only returns the parent of A
[ <div class="active">...</div> ]
| Parameter | Type | Description |
|---|---|---|
| selector | string | Optional. A string containing a selector expression to match the parent against. |
Returns: A new SR object.