Easy Tutorial
❮ Dom Prop Attr Specified Dom Nodes Add ❯

XML DOM isId Attribute



Definition and Usage

The isId attribute returns true if the attribute is of type ID (e.g., contains the identifier of its owning element), otherwise it returns false.

Syntax


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and checks if the category attribute is an ID attribute of the <book> element:

Example

xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book');

for(i=0;i&lt;x.length;i++)
{
  document.write(x.item(i).attributes[0].isId);
  document.write("<br>");
}

The above code will output:


❮ Dom Prop Attr Specified Dom Nodes Add ❯