HTML DOM Attribute specified
Example
Is the style attribute specified?:
document.getElementById("myDiv").getAttributeNode("style").specified
Try it Yourself »
Description
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 | Edge | Firefox | Safari | Opera | IE |
Yes | Yes | Yes | Yes | Yes | 9-11 |