The difference between the filter () function and the Find () function of jquery

Source: Internet
Author: User

The difference between the filter () function and the Find () function of jquery:
In jquery, many functions are very convenient to use, while some functions are very close to each other, so it is easy to create a certain error operation.
The filter () function and the Find () function have the same filtering effect, and the difference between them is described below.
A. Filter () function:
This function filters the matching elements in the element collection, and returns a collection of matching elements, for example:

$ ("div"). Filter (". MyTest");

The above code can filter the div of the class attribute value to MyTest in the DIV element collection and return the matching collection.
You can also see that the filter () function is used for filtering the collection of $ ("div").
Two. Find () function:
This function can filter the elements of a set of elements in a matching element, such as:

$ ("div"). Find (". MyTest");

The above code can filter the elements of the DIV's child elements in the class attribute value to MyTest.
Related reading:
The 1.filter () function can be found in the section of the filter () method of jquery .
The 2.find () function can be found in the section of the Find () method of jquery .

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

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

The difference between the filter () function and the Find () function of 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.