Tsallaka zuwa abun ciki
Justice Tech School

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

Which finds the nearest matching ancestor?

These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.