FunctionsElementGetRootElementGetRoot CallableElementGetRoot(elem: Node): Document | ShadowRootReturns 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.Parameterselem: NodeReturns 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.