<span id="s1" style="color: red;">Some text</span>CSSStyleDeclaration: cssText property / notebook
CSSStyleDeclaration: cssText property
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
const elem = document.getElementById("s1");
console.log(elem.style.cssText); // "color: red;"