Latest web development tutorials

XML DOM localName property

Attr Object Reference Attr objects

Definition and Usage

localName property returns the local part of the attribute name.

grammar

attrObject.localName


Examples

The following code fragment uses loadXMLDoc () to " books_ns.xml " into xmlDoc and returns the local name "lang" attribute:

Examples

xmlDoc=loadXMLDoc("books_ns.xml");

x=xmlDoc.getElementsByTagName('title');

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

The code above will output:

lang
lang

try it"

Attr Object Reference Attr objects