The difference between jquery's filter () function and find () function, jqueryfilter

Source: Internet
Author: User

The difference between jquery's filter () function and find () function, jqueryfilter

The differences between jquery's filter () function and find () function:
Many functions in jQuery are very convenient to use. At the same time, some functions are very close to each other, which may also cause some misoperations.
The filter () function and the find () function have the same filtering function. The following describes the differences between them.
I. filter () function:
This function is used to filter the matching elements in the element set and return the Matching Element Set. For example:

 

$ ("Div"). filter (". mytest ");

 

The above code filters out the div whose class attribute value is mytest In the div Element Set and returns a matching set.
We can also see that the filter () function is used to filter the $ ("div") set.
Ii. find () function:
This function filters child elements in the element set, for example:

 

$ ("Div"). find (". mytest ");

 

The code above filters out the elements whose class attribute value is mytest in the child element of the div.
Related reading:
1. For more information about the filter () function, see the filter () method section of jQuery.
2. For more information about the find () function, see find () method in jQuery.

The original address is: http://www.softwhy.com/forum.php? Mod = viewthread & tid = 9344.

For more information, see: http://www.softwhy.com/jquery/

 

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.