Const
Get the parent of each element in the current set of matched elements, optionally filtered by a selector.
Optional
If specified filter for parent.
The parents.
$('.pear').parent().attr('id');//=> fruits Copy
$('.pear').parent().attr('id');//=> fruits
https://api.jquery.com/parent/
Get the parent of each element in the current set of matched elements, optionally filtered by a selector.