Difference between parent and parents in jquery

parent()

The parent() function travels only one level up in the DOM tree. So parent() will select the first parent element.

parents()

The parents() function travels up the DOM tree till the document's root element.

Note: We can also use filter with these function.

CODE
DISPLAY
Ram
Mohan


No comments :

Please Give Your Feedback