Skip to main content

ElementGetRoot

Callable

  • ElementGetRoot(elem: Node): Document | ShadowRoot

  • Returns the element's document- or shadow-root.

    If an element is not part of the DOM tree, thus lacking a document- or shadow-root, then document is returned.


    Parameters

    • elem: Node

    Returns Document | ShadowRoot