Parent Methods
parent, parents and closest walk up the tree.
Example
$("li").parent();
$("li").parents("ul");
$("li").closest("div");
$("li").parentsUntil("body");Exercise
Nearest ancestor.
$("li").("div")
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.