web api instance property
Document: rootElement property
Document.rootElement returns the Element
that is the root element of the document if it is an
<svg> element, otherwise null. It is deprecated in favor of
documentElement, which returns the root element for all
documents.
Value
For SVG elements, the Element that is the root element of the document; otherwise null.
If the document is a non-empty SVG document, then the rootElement will be
an SVGSVGElement, identical to the documentElement.
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.