Phương thức CSSStyleDeclaration getPropertyValue ()
❮ Đối tượng CSSStyleDeclaration
Ví dụ
Trả về giá trị của thuộc tính color:
var declaration = document.styleSheets[0].cssRules[0].style;
var
propvalue = declaration.getPropertyValue("color");
alert(propvalue);
Hãy tự mình thử »Sự miêu tả
Phương thức getPropertyValue() trả về giá trị của thuộc tính CSS được chỉ định.
Hỗ trợ trình duyệt
Method | |||||
---|---|---|---|---|---|
getPropertyValue() | Yes | 9.0 | Yes | Yes | Yes |
Cú pháp
object .getPropertyValue( propertyname )
Giá trị tham số
Parameter | Description |
---|---|
propertyname | Required. A String representing the name of the property to check |
Chi tiết kỹ thuật
Phiên bản DOM: | Mô hình đối tượng CSS |
---|---|
Giá trị trả về: | Một chuỗi, biểu thị giá trị của thuộc tính |