HTML DOM specified Property
Example
Find out if an attribute has been specified or not:
var x =
document.getElementById("demo").attributes[0].specified;
Try it Yourself »
Definition and Usage
The specified property returns true if the attribute is specified.
Returns true also if the attribute has been created but not been attached to an element yet.
Note: this property does not return false if the attribute is not specified, instead it returns an error.
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| specified | Yes | Yes | Yes | Yes | Yes |
Syntax
attribute.specified
Technical Details
| Return Value: | A Boolean true if the attribute is specified, otherwise it returns an error |
|---|---|
| DOM Version | Core Level 1 |
