XML DOM ownerDocument Property
Node object
Definition and Usage
The ownerDocument property returns the root element (document object) of a node.
Syntax
nodeObject.ownerDocument
Example
The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc, and return whether the first
Example
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("title")[0].ownerDocument;
document.write("Nodename: " + x.nodeName);
document.write(" (nodetype: " + x.nodeType + ")");
The code above will output:
Nodename: #document (nodetype: 9)
Try it »
Node object