Node: ownerDocument-Eigenschaft
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.
Die schreibgeschützte ownerDocument
-Eigenschaft der Node
-Schnittstelle
gibt das oberste Document-Objekt des Knotens zurück.
Wert
Ein Document
, das das oberste Objekt ist, in dem alle untergeordneten Knoten erstellt werden.
Wenn diese Eigenschaft auf einem Knoten verwendet wird, der selbst ein Dokument ist, ist der Wert null
.
Beispiel
js
// Given a node "p", get the top-level HTML
// child of the document object
const d = p.ownerDocument;
const html = d.documentElement;
Spezifikationen
Specification |
---|
DOM # ref-for-dom-node-ownerdocument① |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
ownerDocument |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- Has more compatibility info.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.