Latest web development tutorials

HTML DOM specified attribute

Property Object Reference Attribute object

Examples

Check whether the attribute has the value specified:

document.getElementById("demo").attributes[0].specified;

Output:

true

try it"

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.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support specified property


grammar

attribute .specified

technical details

return value: Boolean, true | false
DOM version Core Level 1


Property Object Reference Attribute object