Retrieves the document object associated with the node.
SyntaxNote: This property is read-only.
var doc = element.ownerDocument;
Return Value
Returns an object of type DOM NodeDOM Node
The document Node of the web page or iframe or frame.
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.
Examples// given a node "p", get the top-level HTML child
// of the document object
var doc = p.ownerDocument;
alert(doc.outerHTML);
var html = doc.documentElement;
alert(html.outerHTML);
Usage
Used to build the DOM tree of documents that contain <iframe>, <frame> and <frameset> elements.
Notes Remarks
The ownerDocument is the Document object that is used to create new nodes. This property returns null when the node is a Document. ownerDocument was introduced in Microsoft Internet Explorer 6.
Syntaxvar doc=element.ownerDocument;
Related specificationsMozilla Developer Network : [Node.ownerDocument Article]
Microsoft Developer Network: [ownerDocument Property Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4