HTML DOM ownerDocument Property
Example
Return the root element of the element:
document.getElementById("demo").ownerDocument;
Try it »
Definition and Usage
The ownerDocument property returns the root element of an element.
In HTML, the HTML document itself is the root element.
For more document objects, please refer to our Document Object Reference Manual.
Browser support





All major browsers support the ownerDocument property
Syntax
node
.ownerDocument
Technical Details
| Return Value: | The owner document of a node, as a document object. |
|---|---|
| DOM version | Core Level 2 Node Object |
Element object