X
HOME HTML5 CSS3 JAVASCRIPT SQL PHP5 JQUERY ANGULAR BOOTSTRAP3 XML MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

jQuery parent > child Selector

jQuery Selectors jQuery Selectors

Example

Select all <span> elements that are a direct child of a <div> element:

$("div > span")

Try it yourself »

Definition and Usage

The ("parent > child") selector selects all elements that are a direct child of the specified element.


Syntax

("parent > child")

Parameter Description
parent Required. Specifies the parent element to be selected
child Required. Specifies the direct child element (of the specified parent element) to be selected


Examples

Try it Yourself - Example

Select all <li> elements that are a direct child of an <ul> element
How to select all <li> elements that are a direct child of an <ul> element with a classname.


jQuery Selectors jQuery Selectors


Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE

facebook