Function getNestedChildren

  • Gets all deeply nested elements contained within the given element. Shadow DOMs are traversed.

    Note that <slot> elements are included, as well as their nested elements (even if a slot filler is provided by the parent) and the slot filler itself (if provided).

    Optionally define a second "depth" input to control how far nestings should be pursued. Leave depth out or set it to undefined or any value <= 0 to allow full depth search.

    Parameters

    • startingElement: Readonly<Element>
    • Optionaldepth: number

    Returns Element[]