Gets or sets the textual representation of a style sheet.
Property of css/cssom/styleSheetcss/cssom/styleSheet
Syntaxvar cssText = stylesheet.cssText;
stylesheet.cssText = cssText;
Return Value
Returns an object of type StringString
The textual representation of the style sheet.
ExamplesThis example uses the cssText property to retrieve the CSS style set on an object.
<p id="oPara" style="color: green; font-weight: bold;">
This is the test paragraph.</p>:
<button onclick="console.log(document.getElementById('oPara').style.cssText)">Get CSS attributes</BUTTON>
Notes
This property reflects the current state of the style sheet and not its initial value.
Related specificationscssText
Microsoft Developer Network: [Windows Internet Explorer API reference Article]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4