Latest web development tutorials

XML DOM ownerDocument property

Attr Object Reference Attr objects

Definition and Usage

ownerDocument property returns the root element node belongs (document object).

grammar

attrObject.ownerDocument


Examples

The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, and returns the first element of the root node attribute category:

Examples

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName('book');

document.write(x.item(0).attributes[0].ownerDocument);
document.write("
");
document.write(x.item(0).attributes[0].ownerDocument.nodeName);
document.write("
");
document.write(x.item(0).attributes[0].ownerDocument.nodeType);

The code above will output:

[object XMLDocument]
#document
9

try it"

Attr Object Reference Attr objects