JSFiddle - React, Tailwind, and code Playground
HTML
<iframe id="myFrame"></iframe>
<p class="bb">Testing2</p>
CSS
.bb{font-size:30px;}
.bB{color:red;}
.bc{font-weight:bold;}
JavaScript
var fDoc = document.getElementById("myFrame").contentWindow.document;
var fStyle = fDoc.createElement("STYLE");
fStyle.innerHTML = ".ab{font-size:30px;}\n.AB{color:red;}\n.ac{font-weight:bold;}";
fDoc.head.appendChild(fStyle);
var p = fDoc.createElement("P");
p.className = "ab";
p.innerHTML = "Testing";
fDoc.body.appendChild(p);