ZVON > References > DOM1 Reference

specified (attribute)

Owning interface and usage:  
Attr.specified

Member of these other interfaces :  
none

Readonly:   yes

Type:   Boolean

Description:  
Thanks to this attribute you can find out something about "DTD-background" of tested attribute. In summary: If the attribute has an assigned value in the document then specified is true, and the value is the assigned value. If the attribute has no assigned value in the document and has a default value in the DTD, then specified is false, and the value is the default value in the DTD. If the attribute has no assigned value in the document and has a value of #IMPLIED in the DTD, then the attribute does not appear in the structure model of the document.


Example:
JavaScript:
  var attr = document.createAttribute('temp');
  attr.value = 'temporary';
  var output = attr.specified;
Output:
desired your browser
true