August 2013
Beginner
70 pages
1h 26m
English
This chapter explains how to combine the selectors seen so far using hierarchy operators to retrieve elements by their relationship in the DOM.
Before we dive into the code, we should be aware of the weapons in our belt. The following is a table describing all of the selectors that belong to this category:
|
Name |
Identifying Character |
Syntax |
Description |
|---|---|---|---|
|
Child |
> |
Parent > Children (for example, |
Selects all direct children "Children" of the parent specified by "Parent". |
|
Descendant |
(space) |
Ancestor Descendants (for example, . |
Selects all descendants "Descendants" having in their ancestor list "Ancestor". |
|
Next Adjacent |
+ |
Prev + Next (for example. |
Selects ... |
Read now
Unlock full access