English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
JavaScript CSSStyleDeclaration-Objekt
getPropertyPriority()方法返回给定CSS属性是否设置了“!important”优先级。
如果返回 "important" 则表明设置了优先级,否则没有。
object.getPropertyPriority(property)
var declaration = document.styleSheets[0].rules[0].style; var isImportant = declaration.getPropertyPriority('color'); document.getElementById("result").innerHTML = isImportant;Testen Sie heraus‹/›
Das getPropertyPriority()-Verfahren wird von allen Browsern vollständig unterstützt:
Methode | |||||
getPropertyPriority() | Ja | Ja | Ja | Ja | Ja |
Parameter | Beschreibung |
---|---|
property | Eine Zeichenkette, die den Namen der zu überprüfenden Eigenschaft darstellt |
Rückgabewert: | Eine Zeichenkette, die die Priorität darstellt, ist leer, wenn sie nicht existiert |
---|---|
DOM-Version: | CSS-Objektmodell |