Home »
MCQs »
jQuery MCQs
Which jQuery method is used to get the all ancestor elements of the selected element, all the way up to the document's root element (<html>)?
89. Which jQuery method is used to get the all ancestor elements of the selected element, all the way up to the document's root element (<html>)?
- parent()
- parents()
- parentsUntil()
- All of the above
Answer: B) parents()
Explanation:
jQuery method parents() is used to get the all ancestor elements of the selected element, all the way up to the document's root element (<html>).