English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
JavaScript CSSStyleDeclaration Object
The getPropertyValue() method returns the value of the specified CSS property.
object.getPropertyValue(property)
var declaration = document.styleSheets[0].rules[0].style; var val = declaration.getPropertyValue('color'); document.getElementById("result").innerHTML = val;Test and see‹/›
All browsers fully support the getPropertyValue() method:
Method | |||||
getPropertyValue() | Yes | Yes | Yes | Yes | Yes |
Parameter | Description |
---|---|
property | A string representing the name of the attribute to be checked |
Return value: | A string representing the attribute value |
---|---|
DOM Version: | CSS Object Model |