The localName property returns the local part of the name of a node.
For nodes of other types than ELEMENT_NODE, ATTRIBUTE_NODE, and nodes created with a DOM Level 1 method, the return value is always null.
The localName property is supported in all major browsers, except Internet Explorer.
Return Value: | A String representing the local name of the node |
---|---|
DOM Version | Core Level 2 Node Object |
The following code fragment loads "books.xml" into xmlDoc using loadXMLDoc() and returns the local name of the <title> elements:
The output of the code above will be: