Unsere Freiwilligen haben diesen Artikel noch nicht in Deutsch übersetzt. Machen Sie mit und helfen Sie, das zu erledigen!
Sie können den Artikel auch auf English (US) lesen.

The Node.ownerDocument read-only property returns the top-level document object for this node.

Syntax

document = element.ownerDocument
  • document is the document object parent of the current element.

Example

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

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

Notes

The document object returned by this property is the main object with which all the child nodes in the actual HTML document are created. If this property is used on a node that is itself a document, the result is null.

Specifications

Specification Status Comment
DOM4
The definition of 'Node.ownerDocument' in that specification.
Obsolete  
Document Object Model (DOM) Level 3 Core Specification
The definition of 'Node.ownerDocument' in that specification.
Obsolete No change
Document Object Model (DOM) Level 2 Core Specification
The definition of 'Node.ownerDocument' in that specification.
Obsolete Initial definition

Browser compatibility

FeatureChromeEdgeFirefoxInternet ExplorerOperaSafari
Basic support Yes12

Yes

91

62 Yes ?
FeatureAndroid webviewChrome for AndroidEdge mobileFirefox for AndroidOpera AndroidiOS SafariSamsung Internet
Basic support Yes Yes Yes

Yes

91

Yes ? Yes

1. The ownerDocument of doctype nodes (that is, nodes for which Node.nodeType is Node. DOCUMENT_TYPE_NODE or 10) is no longer null. Instead, the ownerDocument is the document on which document.implementation.createDocumentType() was called.

2. See MSDN.

Schlagwörter des Dokuments und Mitwirkende

Schlagwörter: 
Zuletzt aktualisiert von: fscholz,