CSSStyleDeclaration getPropertyPriority () 메서드
예시
color 속성에 "중요!"가 있는지 여부를 반환합니다. 우선순위 설정:
var declaration = document.styleSheets[0].cssRules[0].style;
var
priority = declaration.getPropertyPriority("color");
alert(priority);
정의 및 사용
getPropertyPriority() 메서드는 지정된 CSS 속성에 "중요!"가 있는지 여부를 반환합니다. 우선 순위 설정.
이 메서드가 "중요"를 반환하면 중요 한정자가 설정됩니다.
이 메서드가 빈 문자열을 반환하면 중요한 한정자가 설정되지 않습니다.
브라우저 지원
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 버전: | CSS 객체 모델 |
---|---|
반환 값: | 우선 순위를 나타내는 문자열 또는 존재하지 않는 경우 빈 문자열 |
❮ CSSStyleDeclaration 객체