HTML DOM specifiedProperty
Example
Check whether the attribute has a specified value:
document.getElementById("demo").attributes[0].specified;
Output:
true
Try it Yourself »
Definition and Usage
If the attribute value is set in the document, the specified property returns true; if it is a default value in DTD/Schema, it returns false.
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the specified property
Syntax
attribute.specified
Technical Details
| Return Value: | Boolean, true|false |
|---|---|
| DOM Version | Core Level 1 |
Other Extensions
Attribute Object