Is the style attribute specified?:
document.getElementById("myDiv").getAttributeNode("style").specified
Try it Yourself »
The specified
property returns true
if an attribute is specified.
This property returns an error if the attribute is not specified.
This might crash your program.
attribute.specified
Type | Description |
A boolean | true if the attribute is specified.Otherwise it returns an error. |
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 |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!