Home  >  Article  >  Web Front-end  >  The difference between Jquery find and filter functions Description_jquery

The difference between Jquery find and filter functions Description_jquery

WBOY
WBOYOriginal
2016-05-16 18:27:341171browse

find() will look for elements with class classname within the div element.
filter() filters out elements whose class is classname.

Basically, find sub-elements are found, and filter is a level search.

·The find function is to query the sub-elements of the current object collection;
·The filter function is to query the current object collection Filter and use filter conditions to narrow the scope;
·The parameter of the find function is a jQuery selector expression; The parameter of
·filter is also a selector expression, but there can be multiple conditions, separated by commas (logical OR relationship);
·The parameter of filter can also be a function. When calling the function, the index parameter will be automatically passed in. The function needs to return true or false to select or exclude elements.


Statement:
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