A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/css/cssom/styleSheet/cssText below:

cssText ยท WebPlatform Docs

cssText Summary

Gets or sets the textual representation of a style sheet.

Property of css/cssom/styleSheetcss/cssom/styleSheet

Syntax
var cssText = stylesheet.cssText;
stylesheet.cssText = cssText;
Return Value

Returns an object of type StringString

The textual representation of the style sheet.

Examples

This 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>

View live example

Notes

This property reflects the current state of the style sheet and not its initial value.

Related specifications
DOM Level 2 Style
Recommendation
See also Related articles CSSOM Related pages Attributions

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