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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-16 17:31:20
Original
1073 people have browsed it
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:

[ , ]
Related labels:
Statement of this Website
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
Latest Issues
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template