Home > Web Front-end > JS Tutorial > body text

The difference between Jquery find and filter functions Description_jquery

WBOY
Release: 2016-05-16 18:27:34
Original
1203 people have browsed it

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.


Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template