Easy Tutorial
❮ Prop Comment Data Dom Documentimplementation ❯

XML DOM ownerElement Property



Definition and Usage

The ownerElement property returns the element node to which the attribute belongs.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and returns the element node to which the first category element belongs:

Example

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName('book');

document.write(x.item(0).attributes[0].ownerElement);
document.write("<br>");
document.write(x.item(0).attributes[0].ownerElement.nodeName);
document.write("<br>");
document.write(x.item(0).attributes[0].ownerElement.nodeType);

The above code will output:


❮ Prop Comment Data Dom Documentimplementation ❯