Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM specified Property

HTML DOM specified Property

Attribute Object Reference Attribute object

Example

Checks whether the attribute has a specified value:

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

Output result:

true

Try it »


Definition and Usage

If the attribute value is set in the document, the specified property returns true; if it is a default value from the DTD/Schema, it returns false.


Browser support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the specified property.


Syntax

attribute

.specified

Technical Details

Return Value: Boolean, true|false
DOM version Core Level 1

Attribute Object Reference Attribute object