Return elements that are direct children of <ul>:
The children() method returns all direct children of the selected element.
The DOM tree: This method only traverse a single level down the DOM tree. To traverse down multiple levels (to return grandchildren or other descendants), use the find() method.
Note: This method does not return text nodes. To return all children including text nodes, use the contents() method.
|filter||Optional. Specifies a selector expression to narrow down the search for children|
Return all direct children of <ul>
How to return all direct children of an <ul> element.
Narrow down the search
How to use the filter parameter to return all <li> elements with the class name "1", that are direct children of <ul>.
Return all <p> elements that are direct children of
How to select all <p> elements that are direct children of their parent <div> element.
the descendants of an element by tag names
A demonstration which shows who the descendants of a <div> element actually are.