XML DOM specified 属性

定义和用法
如果在文档中设置了属性值,则 specified 属性返回 true,如果是 DTD/Schema 中的默认值,则返回 false。
语法
attrObject.specified
下面的代码片段使用 books.xml" 载入 xmlDoc 中,并显示 category 属性的名称和值:
实例代码
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("<br>");
}
输出:
true
true
true
true
true
true
true
