Latest web development tutorials

jQuery parent descendant selector

jQuery selector jQuery selector

Examples

Select <div> element descendants of all the <span> element:

$("div span")

try it"

Definition and Usage

( "Parent descendant") all the elements of selectors select specific elements of future generations.

Descendant element may be the first generation of the element, the second generation, third generation and so on.


grammar

(" parent descendant ")

参数 描述
parent 必需。规定要选取的父元素。
descendant 必需。规定要选取的(指定父元素的)后代元素。


Examples

Try - Example

All <li> element select <ul> element descendants
All <li> elements of how to select the <ul> element descendants.


jQuery selector jQuery selector