XML DOM localName property
Definition and usage
The localName property can return the local part of a node name.
Syntax:
nodeObject.localName
Example
In all examples, we will use the XML file books_ns.xml, and the JavaScript function loadXMLDoc().
The following code snippet can return the local name of the <title> element:
xmlDoc=loadXMLDoc("books_ns.xml");
var x=xmlDoc.getElementsByTagName('title');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).localName
);
document.write("<br />");
}
Output:
title title