Latest web development tutorials

XML DOM localName property

Node Object Reference Node objects

Definition and Usage

localName property returns the local part of the node name.

grammar

nodeObject.localName


Examples

The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc and returns the local name <title> element:

Examples

xmlDoc=loadXMLDoc("books_ns.xml");

x=xmlDoc.getElementsByTagName('title');

for(i=0;i<x.length;i++)
{
document.write(x.item(i).localName);
document.write("
");
}

The above code will output:

title
title

try it"

Node Object Reference Node objects