cycling jQuery_Succinctly | Page 40
With a clear understanding of manipulating the set itself, we can augment our understanding of
selecting elements by using filters that select elements that have unique relationships with other
elements within the actual DOM. jQuery provides several selectors to do this. Some of these
selectors are custom, while some are well known CSS expressions for selecting DOM elements.
ancestor descendant
parent > child
prev + next
prev ~ siblings
:nth-child(selector)
:first-child
:last-child
:only-child
:empty
:has(selector)
:parent
Usage of these selector filters will select elements based on their relationship within the DOM as
pertaining to other elements in the DOM. To demonstrate this concept, let's look at some code.
Sample: sample28.html