jQuery parent > childSelector
Examples
Select <span> elements that are direct children of a <div> element:
$("div > span")
Try it Yourself »
Definition and Usage
The ("parent > child") selector selects all elements that are direct children of the specified parent element.
Syntax
("parent > child")
| Parameter | Description |
|---|---|
| parent | Required. Specifies the parent element to select. |
| child | Required. Specifies the direct child element to select (belonging to the specified parent element). |
Try it Yourself - Examples
Select all <li> elements that are direct children of a <ul> element
How to select all <li> elements that are direct children of a <ul> element with classname.
Other Extensions
jQuery Selector