XML DOM specified attribute
Definition and Usage
If you set the property value in the document, the specified property returns true, if the DTD / Schema default value, it returns false.
grammar
attrObject.specified
Examples
The following code fragment uses loadXMLDoc () to " the Books.xml " into xmlDoc, and displays the name and value of the category attribute:
Examples
xmlDoc=loadXMLDoc("books.xml");
x=xmlDoc.getElementsByTagName('book');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].specified);
document.write("
");
}
x=xmlDoc.getElementsByTagName('book');
for(i=0;i<x.length;i++)
{
document.write(x.item(i).attributes[0].specified);
document.write("
");
}
Output:
true
true
true
true
true
true
true
try it"
Attr objects