• A utility function that retrieves all direct children of a given HTML element that match a specified CSS selector.

    It is a replacement for the jQuery children() method, providing similar functionality without the need for jQuery.

    Parameters

    • element: HTMLElement

      The parent HTML element from which to retrieve child elements.

    • selector: string

      A string containing one or more CSS selectors separated by commas. This string is used to filter the children of the element parameter.

    Returns NodeListOf<Element>

    A NodeList of elements that are direct children of the element parameter and match the provided CSS selector(s). If no matching elements are found, the function returns an empty NodeList.

    Example

    // Get an element by its GUID
    const parentElement = ix.api.dom.getHtml("<ELEMENT-GUID>");

    // Get all direct "div" children of the element with id "parent"
    const divChildren = ix.api.dom.children(parentElement, "div");