XML DOM specifiedプロパティ


Attr 对象参考手册Attr オブジェクト

定義と用法

ドキュメント内で属性値が設定されている場合、specified プロパティは true を返し、DTD/Schema のデフォルト値の場合は false を返します。

構文

attrObject.specified


例

以下のコードスニペットはloadXMLDoc()"" を 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

試してみる »

Attr 对象参考手册Attr オブジェクト その他の拡張