Skip to content
Related Articles

Related Articles

Improve Article

Web technologies Questions | jQuery Quiz | Set-3 | Question 15

  • Last Updated : 20 Sep, 2021

Which of the below jQuery method is used to find all the ancestor elements between two given elements in a DOM tree?
(A) $(selector).siblings(function)
(B) $(selector1).parentsUntil(selector2)
(C) $(selector).parent()
(D) $(selector).slice(para1, para2)


Answer: (B)

Explanation: The paentsUtil() is an inbuilt method in jQuery it is used to find all the ancestors of the element between the two Document object model tree. it is www Consortium standard., It means that it defines the element in the Dom tree. It takes parameter “selector2” which is the last marked parent of the tree The return type of parentsUtil() is it returns the ancestor element between the two given elements.

Quiz of this Question
Please comment below if you find anything wrong in the above post

My Personal Notes arrow_drop_up
Recommended Articles
Page :