Node: ownerDocument property

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

The read-only ownerDocument property of the Node interface returns the top-level document object of the node.

Value

A Document that is the top-level object in which all the child nodes are created.

If this property is used on a node that is itself a document, the value is null.

Example

js
// Given a node "p", get the top-level HTML
// child of the document object

const d = p.ownerDocument;
const html = d.documentElement;

Specifications

Specification
DOM
# ref-for-dom-node-ownerdocument①

Browser compatibility

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
ownerDocument

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Has more compatibility info.