Return whether or not the color property has the "important!" priority set:
var declaration = document.styleSheets[0].cssRules[0].style;
var priority = declaration.getPropertyPriority("color");
alert(priority);
Try it Yourself »
The getPropertyPriority() method returns whether or not the specified CSS property has the "important!" priority set.
If this method returns "important", the important qualifier is set.
If this method returns an empty string, the important qualifier is not set.
Method | |||||
---|---|---|---|---|---|
getPropertyPriority() | Yes | 9.0 | Yes | Yes | Yes |
object.getPropertyPriority(
propertyname)
Parameter | Description |
---|---|
propertyname | Required. A String representing the name of the property to check |
DOM Version: | CSS Object Model |
---|---|
Return Value: | A String, representing the priority, or an empty string if it does not exists |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!