The example in this article describes the usage of find() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:
This method gets the child elements of all elements in the matching element collection and deletes them by selector, jQuery object or element.
The find() method is a good way to get descendant elements of the matching element.
Note: children() only gets first-level child elements, while find() will find all child elements.
Grammar structure 1:
Parameter list:
Example code:
I am grandson p
I am my sonp
I am a brotherp
The above code can set the font color of all p elements under the father element to red.
Grammar structure 2:
Can find the specified element under the matching element.
Parameter list:
예제 코드: