Parents and Children
parent, parents, children and closest move up and down the tree. closest finds the nearest ancestor that matches.
Example
$('span').parent();
$('ul').children('li');
$('button').closest('.card');Exercise
Nearest matching ancestor.
$('b').('.card')
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.