The difference between find() and children() in jq

The find() method returns the descendant elements of the selected element, descendants are children, grandchildren, great-grandchildren, and so on. Often used in conjunction with eq()

DOM tree:

       The find() method traverses down the descendants of the DOM element until all paths (<html>) of the last descendant. To just traverse down a single level in the DOM tree (returning immediate children), use the  children()  method

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325478211&siteId=291194637