THE WORLD'S LARGEST WEB DEVELOPER SITE

HTML DOM ownerDocument Property

Element Object Reference Element Object

Example

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

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

The result of x will be:

9

Try it yourself »

Definition and Usage

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

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

Read more about the Document object in our Document object reference.


Browser Support

Property
ownerDocument Yes Yes Yes Yes Yes

Syntax

node.ownerDocument

Technical Details

Return Value: The owner document of the node, as a Document object
DOM Version Core Level 2 Node Object

Element Object Reference Element Object


COLOR PICKER

colorpicker

SHARE THIS PAGE






Search w3schools.com:

Translate w3schools.com: