Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

XML DOM localName Property

XML DOM localName Property


Node Object Reference Node object


Definition and Usage

The localName property returns the local part of a node's name.

Syntax

nodeObject.localName


Example

The following code snippet uses loadXMLDoc() to load "books.xml" Load into xmlDoc, and return the Get the element's local name:</p>

Example

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 code above will output:

title

title

Try it »


Node Object Reference Node object