It can be seen that the value of parent is very clear, which is the parent element of the current element; parents is the ancestor element of the current element. Examples are listed below:
$('p').parent() gets div2, div3, div4
$('p').parent('.a') gets div3
$('p').parent().parent() obtains div1, which is rather strange; however, the characteristics of the Jquery object itself determine that this is feasible.
$('p').parents() gets div1, div2, div3, div4
$('p').parents('.a') gets div3
parent (exp) Usage: Get an element set containing the unique parent element of all matching elements.