Document: rootElement property
MDN Web Docs · نسخهٔ df622a2a1c1e · CC BY-SA 2.5 و مجوز جداگانهٔ ناشر برای نمونهکد
{{ApiRef("DOM")}}
The **rootElement** read-only property of the {{domxref("Document")}} interface returns the {{domxref("Element")}} that is the root element of the {{domxref("document")}} if it is an {{SVGElement("svg")}} element, otherwise null. It is deprecated in favor of {{domxref("Document.documentElement")}}, which returns the root element for all documents.
Value
For SVG elements, the {{domxref("Element")}} that is the root element of the {{domxref("document")}}; otherwise null.
If the document is a non-empty SVG document, then the rootElement will be an {{domxref("SVGSVGElement")}}, identical to the documentElement.
Specifications
{{Specifications}}
Browser compatibility
{{Compat}}