MDN self-hosted library · e01.org

Content-Security-Policy: style-src-attr directive

Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.

html
<div style="display: inline">Foo</div>
js
document.querySelector("div").setAttribute("style", "display: inline");
document.querySelector("div").style.cssText = "display: inline";
js
document.querySelector("div").style.display = "inline";