December 2013
Intermediate to advanced
384 pages
9h 54m
English
$("div#menu").parent(); //selects the <div> element with id="menu" and // then finds its immediate parent $("#data").parents("div"); //selects the element with id="data" and then //returns a set with all <div> ancestors $("#data").parentsUntil("#menu"); //selects the parents of #data until //it finds the one with id="#menu"
The .parent([selector]) method returns a jQuery object representing the immediate parent objects of each of the elements represented in the current set. An optional selector argument allows you to limit the results to those parents matching the selector.
The .parents([selector]) method returns a jQuery object representing the ancestors ...
Read now
Unlock full access