What is the difference between children and find in jquery?

Source: Internet
Author: User

First, jquery in children

Grammar

. Children (selector)

Description

Expr is an expression, an optional argument, in which all the expressions in the selector can be used, such as by the tag name "Div", by the class name ". Class", by the ordinal ": first" and so on, if the expression is empty, then return all children, return the result is still a jquery object.


Second, the jquery find


The find () method gets the descendants of each element in the current element collection, filtered by a selector, JQuery object, or element.

Grammar

. Find (selector)

Description

Its accepted selector expression is the same as the type of the expression we passed to the $ () function. The elements are filtered by testing whether the elements match the expression.



Third, the difference between children and find in jquery

1. Children and find methods are used to obtain the sub-elements of element, neither of which will return text node, just like most jquery methods.


2. The children method obtains only the child element of the element one subordinate


3. Find method obtains all subordinate elements


4. The parameter selector of the children method is optional (optionally), which is used to filter the child elements, but the parameter selector method of the Find method is required.


5. The Find method can in fact be implemented by using JQuery (selector, context)



Reference: The difference between children and find in jquery http://www.studyofnet.com/news/974.html


This article is from the "Learning also leisure" blog, please be sure to keep this source http://studyofnet.blog.51cto.com/8142094/1703241

What is the difference between children and find in jquery?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.