HTML DOM ownerDocumentProperty
Examples
Return the root element of an element:
document.getElementById("demo").ownerDocument;
Try it Yourself »
Definition and Usage
ownerDocument returns the root element of an element.
In HTML, the HTML document itself is the root element of an element.
For more document objects, please refer to ourDocument Object Reference Manual。
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the ownerDocument property.
Syntax
node.ownerDocument
Technical Details
| Return Value: | The document of the node, such as a document object. |
|---|---|
| DOM Version | Core Level 2 Node Object |
Other Extensions
Element Object