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