Skip to content
Justice Tech School

Combining Selectors

Use commas to select several groups, spaces for descendants and > for direct children.

Example
$('h1, h2, p');
$('ul li');
$('ul > li');
$('a[target="_blank"]');

Exercise

Select direct children.

$('ul  li')

Quiz Test

What does a comma do?

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