": matches all child elements under a given parent element; the other is to match all descendant elements under a given ancestor element. The specific overview and usage examples are as follows. Interested friends can refer to Haha"/> ": matches all child elements under a given parent element; the other is to match all descendant elements under a given ancestor element. The specific overview and usage examples are as follows. Interested friends can refer to Haha">

Home >Web Front-end >JS Tutorial >Jquery selection sub-control 'greater than sign' and '' difference introduction and usage examples_jquery

Jquery selection sub-control 'greater than sign' and '' difference introduction and usage examples_jquery

WBOY
WBOYOriginal
2016-05-16 17:31:201045browse
parent > child

Overview
Matches all child elements under a given parent element

Parameters
parentSelector any valid selector
childSelector The selector used to match the element and it is a child of the first selector

Example
Description:
Matches all child input elements in the form.

HTML code:
Copy code The code is as follows:










jQuery code:
Copy code The code is as follows:

$("form > input")

Result:
Copy code The code is as follows:

[ ]

ancestor descendant

Overview
In giving Matches all descendant elements under a given ancestor element

Parameters
ancestorSelector Any valid selector
descendantSelector The selector used to match the element, and it is the first selection Descendant elements

Example
Description:
Find all input elements in the form

HTML code:
Copy code The code is as follows:







< ;/fieldset>



jQuery code:
Copy code The code is as follows:

$("form input")

Result:
Copy code The code is as follows:

[ , ]
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn