The example in this article describes the use of the filter () function and the Find () function in jquery. Share to everyone for your reference. The specific analysis is as follows:
$ ("Div. cont");
Equivalent to $ ("div"). Find (". Cont")
The filter () function is the function of each object in the collection (what is here, what is obtained).
The Find () function is a child element that finds a matching expression inside each object
Example:
?
1 2 |
<div class= "cont" ><P class= "cont" >asdf</p></div> <div><p class= "cont" >jldf< /p></div> |
The code is as follows:
$ ("div"). Filter (". Cont")//Gets the
The label
Indicates that a DIV element with class cont is found
The code is as follows:
$ ("div"). Find (". Cont")/Get the
The label
After finding the div, find the element with class as cont inside the DIV's child elements
I hope this article will help you with your jquery programming.