HTML DOM Element ownerDocument property

Definition and usage

ownerDocument The property returns the owner document of the node as a Document object.

In HTML, the HTML document itself is always the ownerDocument of an element.

Please visit our Document object reference manual Read more about the Document object in the

Example

Get the node type of the owner document of the <p> element:

var x = document.getElementById("myP").ownerDocument.nodeType;

Try it yourself

Syntax

node.ownerDocument

Technical details

Return value: Return the owner document of a node as a Document object.
DOM Version: Core Level 2 Node Object

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support