HTML DOM Attribute specified
Example
Is the style attribute specified?:
document.getElementById("myDiv").getAttributeNode("style").specified
Try it Yourself »
Definition and Usage
The specified
property returns true
if an attribute is specified.
Warning
This property returns an error if the attribute is not specified.
This might crash your program.
Syntax
attribute.specified
Return Value
Type | Description |
A boolean | true if the attribute is specified.Otherwise it returns an error. |
Browser Support
attribute.specified
is a DOM Level 1 (1998) feature.
It is fully supported in all browsers:
Chrome | IE | Edge | Firefox | Safari | Opera |
Yes | 9-11 | Yes | Yes | Yes | Yes |