CSSStyleDeclaration getPropertyPriority () Metoda
Przykład
Zwróć, czy właściwość color ma wartość „ważne!” zestaw priorytetów:
var declaration = document.styleSheets[0].cssRules[0].style;
var
priority = declaration.getPropertyPriority("color");
alert(priority);
Definicja i użycie
Metoda getPropertyPriority() zwraca, czy określona właściwość CSS ma „ważne!” zestaw priorytetów.
Jeśli ta metoda zwraca „ważne”, ustawiany jest ważny kwalifikator.
Jeśli ta metoda zwraca pusty ciąg, ważny kwalifikator nie jest ustawiony.
Obsługa przeglądarki
Method | |||||
---|---|---|---|---|---|
getPropertyPriority() | Yes | 9.0 | Yes | Yes | Yes |
Składnia
object.getPropertyPriority(propertyname)
Wartości parametrów
Parameter | Description |
---|---|
propertyname | Required. A String representing the name of the property to check |
Szczegóły techniczne
Wersja DOM: | Model obiektowy CSS |
---|---|
Wartość zwrotu: | String, reprezentujący priorytet lub pusty ciąg, jeśli nie istnieje |
❮ Obiekt CSSStyleDeclaration