Get the children of each element in the set of matched elements, optionally filtered by a selector.
const $kids = $('ul').children();
// SR Object containing all direct <li> children
[ <li>Item 1</li>, <li>Item 2</li> ]
const $active = $('ul').children('.active');
// SR Object containing only matching children
[ <li class="active">Item 2</li> ]
| Parameter | Type | Description |
|---|---|---|
| selector | string | Optional. A string containing a selector expression to match elements against. |
Returns: A new SR object.