cssText Redirect 1

« cssText

Summary

cssText returns the actual text of the style rule. To be able to set a stylesheet rule dynamically, see Using dynamic styling information.

Syntax

string = cssRule.cssText 

Example

<style>
body { background-color: darkblue; }
</style>
<script>
  var stylesheet = document.styleSheets[0];
  alert(stylesheet.cssRules[0].cssText); // body { background-color: darkblue; }
</script>

Specification

Document Tags and Contributors

 Last updated by: Sheppy,