These methods use the structure of the DOM tree to locate a new set of elements.
Get the descendants of each element in the current set of matched elements filtered by a selector.
Given a jQuery object that represents a set of DOM elements, the
.find() method allows us to search through the descendants of these elements in the DOM tree and construct a new jQuery object from the matching elements. The
.children() methods are similar, except that the latter only travels a single level down the DOM tree.
The method accepts a selector expression of the same type that we can pass to the
$() function. The elements will be filtered by testing whether they match this selector.
Consider a page with a basic nested list as follows:
<ul class="level-1"> <li class="item-i">I</li> <li class...