JSFiddle - React, Tailwind, and code Playground

HTML

<div id="ppp">
<script type="text/javascript">
var iframeOMid= 'OM300x250'+Math.round(Math.random()*(10000-1))+1; // create multi unique iframe
var iframeOM = document.createElement("IFRAME");
  iframeOM.id = iframeOMid;
  iframeOM.src = "about:blank";
  iframeOM.style.width="300px";
  iframeOM.style.height="250px";
  iframeOM.style.border="0";
  iframeOM.scrolling="no";
  iframeOM.margin="0";
  iframeOM.frameborder="0";

document.body.appendChild(iframeOM); // this can not apply to curent div

var contentOM = '<html><body style="margin:0;padding:0;">dsfsdf<scr'+'ipt type="text/javascript">var abcd;</scr'+'ipt></body></html>';

var doc = iframeOM.contentWindow.document; doc.open(); doc.writeln(contentOM); doc.close(); 
</script>
</div>