XML DOM lengthProperty


NamedNodeMap Object

Definition and Usage

The length property returns the number of nodes in the NamedNodeMap.

Syntax

nodemapObject.length

Example

The following code snippet usesloadXMLDoc()put ""Load into xmlDoc, and retrieve the number of attributes in the first <book> element:"

Example

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName('book');

document.write(x.item(0).attributes.length);

The code above will output:

1

Try it Yourself »

Try it Yourself


NamedNodeMap Objectother extensions