Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM ownerDocument Property

HTML DOM ownerDocument Property

Element Object Reference Element object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Reference Element object