JSFiddle - React, Tailwind, and code Playground

by dbrans

HTML

<script src="https://raw.github.com/iamnoah/element.write/master/element.write.js"></script>
  <script src="https://raw.github.com/iamnoah/writeCapture/writeCapture2/writeCapture2.js"></script>

<div id="native">
<h1>Native</h1>
<h2>Ex 1</h2>
<b>hello <ins>there</ins></b>
<h2>Ex 2</h2>
<p>hello</p> <ins><p>there</p></ins>
</div>

<div id="wc2">
<h1>WriteCapture2</h1>
<h2>Ex 1</h2>
<div id="ex1"></div>
<h2>Ex 2</h2>
<div id="ex2"></div>
<div>

CSS

#native {
    float:left;
}

#wc2 {
    float:right;
}

JavaScript

writeCapture(document.getElementById('ex1')).write(
    "<b>hello <ins>there</ins></b>"
).close();
    
writeCapture(document.getElementById('ex2')).write(
    "<p>hello</p> <ins><p>there</p></ins>"
).close();