JSFiddle - React, Tailwind, and code Playground

by crucify

HTML

<style id="first">
p { font-size:20px; color:red; }
</style>
<div id="third"></div>
<style id="second">
p { font-size:30px; }
</style>

<p>test text</p>
<p><a href="#" onclick="thirding();">thirding</a></p>
<p><a href="#" onclick="fourthing();">fourthing</a></p>

JavaScript

window.thirding = function() {
	document.getElementById('third').innerHTML = '<style>p { font-size:50px; color:blue; }</style>';
}
window.fourthing = function() {
	var s = document.createElement('style');
  s.innerHTML = 'p { font-size:70px; }';
  document.documentElement.appendChild(s);
}