jQuery Parent DescendantSelector
Example
Select all <span> elements that are descendants of a <div> element:
$("div span")
Try it Yourself »
Definition and Usage
The ("parent descendant") selector selects all elements that are descendants of the specified element.
A descendant of an element can be the first generation, second generation, third generation, and so on, of the element.
Syntax
("parent descendant")
| Parameter | Description |
|---|---|
| parent | Required. Specifies the parent element to be selected. |
| descendant | Required. Specifies the descendant elements of the specified parent element to be selected. |
Try it Yourself - Examples
Select all <li> elements that are descendants of a <ul> element
How to select all <li> elements that are descendants of a <ul> element.
Other Extensions
jQuery Selectors