XML DOM ownerElement property
Definition and Usage
ownerElement property returns the property subsidiary element node.
grammar
attrObject.ownerElement
Examples
The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, and returns the first element of a category affiliated element node:
Examples
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book');
document.write(x.item(0).attributes[0].ownerElement);
document.write("
");
document.write(x.item(0).attributes[0].ownerElement.nodeName);
document.write("
");
document.write(x.item(0).attributes[0].ownerElement.nodeType);
x=xmlDoc.getElementsByTagName('book');
document.write(x.item(0).attributes[0].ownerElement);
document.write("
");
document.write(x.item(0).attributes[0].ownerElement.nodeName);
document.write("
");
document.write(x.item(0).attributes[0].ownerElement.nodeType);
The code above will output:
[object Element]
book
1
book
1
try it"
Attr objects