CSSValue.cssText

The cssText property of the CSSValue interface represents the current computed CSS property value.

Syntax

cssText = cssValue.cssText;

Value

A DOMString representing the current CSS property value.

Example

var styleDeclaration = document.styleSheets[0].cssRules[0].style;
var cssValue = styleDeclaration.getPropertyCSSValue("color");
console.log(cssValue.cssText);

Specifications

Specification Status Comment
Document Object Model (DOM) Level 2 Style Specification
The definition of 'CSSValue.cssText' in that specification.
Obsolete Initial definition

Browser compatibility

DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
cssText
Deprecated
Chrome No support NoEdge No support NoFirefox No support 1 — 62IE ? Opera No support NoSafari ? WebView Android No support NoChrome Android No support NoFirefox Android No support 4 — 62Opera Android ? Safari iOS ? Samsung Internet Android No support No

Legend

No support
No support
Compatibility unknown
Compatibility unknown
Deprecated. Not for use in new websites.
Deprecated. Not for use in new websites.

See also