XML DOM ownerDocument Property
Element Object
Definition and Usage
The ownerDocument property returns the document object to which the selected element belongs.
Syntax
elementNode.ownerDocument
Example
The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and from the first
Example
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName("title")[0];
x=x.ownerDocument;
document.write("Nodename: " + x.nodeName);
document.write(" (nodetype: " + x.nodeType + ")");
The code above will output:
Nodename: #document (nodetype: 9)
Try it »
Element Object