XML DOM isId property
Definition and Usage
isId property attribute is the ID type returns true (for example, contains the identifier of the element to which it belongs), otherwise it returns false.
grammar
attrObject.isId
Examples
The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc and returns whether category attribute is the ID attribute <book> element:
Examples
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].isId);
document.write("
");
}
x=xmlDoc.getElementsByTagName('book');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].isId);
document.write("
");
}
The code above will output:
false
try it"
Attr objects