Explain jQuery parent() Method?

Answer

The parent() method returns the direct parent element of the selected element.This method only traverse a single level up the DOM tree.

The parents() method returns all ancestor elements of the selected element, all the way up to the document's root element (<html>).

 

Example

$(document).ready(function(){
    $("span").parents();
});

All JQUERY Questions

Ask your interview questions on jquery

Write Your comment or Questions if you want the answers on jquery from jquery Experts
Name* :
Email Id* :
Mob no* :
Question
Or
Comment* :
 





Disclimer: PCDS.CO.IN not responsible for any content, information, data or any feature of website. If you are using this website then its your own responsibility to understand the content of the website

--------- Tutorials ---