Node: ownerDocument プロパティ

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.

ownerDocumentNode インターフェイスの読み取り専用プロパティで、このノードの最上位の文書オブジェクトを返します。

すべての子ノードが作成された最上位の Document オブジェクトです。

このプロパティが文書自身のノードで使用された場合、値は null になります。

js
// 指定された "p" から、文書オブジェクトの子である最上位の HTML を取得します。

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

仕様書

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

ブラウザーの互換性

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.