--- title: CssRule.cssText slug: Web/API/CSSRule/cssText translation_of: Web/API/CSSRule/cssText ---
{{APIRef}}
 

Summary

cssText returns the current text style rule.

Syntax

string = cssRule.cssText

Instance

if (myRule.cssText.indexOf ("background-color")! = -1) {
   bgRule = MyRule;
}
...

Specification

DOM Level 2 Style - cssRule