Latest web development tutorials

jQuery parent> child selector

jQuery selector jQuery selector

Examples

Select <div> element of the direct child elements <span> element:

$("div > span")

try it"

Definition and Usage

All the elements ( "parent> child") selector to select specific elements direct child elements.


grammar

(" parent > child ")

参数 描述
parent 必需。规定要选取的父元素。
child 必需。规定要选取的直接子元素(属于指定的父元素)。


Examples

Try - Example

All <li> element select <ul> element is a direct child elements
How to select the direct child element with classname <ul> element in all <li> elements.


jQuery selector jQuery selector