JSFiddle - React, Tailwind, and code Playground
HTML
<!-- HTML sandbox -->
<div id="sb"></div>
<br />
<textarea id="sbH_source">HTML </textarea>
<textarea id="sbC_source">CSS </textarea>
<br />
<button id="sub_btn">Submit source code</button>
CSS
#sb {
width: 600px;
height: 500px;
border: 1px solid #000;
}
#sbH_source, #sbC_source {
width: 300px;
height: 200px;
margin: 0px;
padding: 0px;
}
JavaScript
$(document).ready(function () {
$("#sub_btn").click(function(){
// Submit HTML
var sourceH = "";
sourceH = $("#sbH_source").val();
$("#sb").html(sourceH);
// Submit CSS
var sourceC = "";
sourceC = $("#sbC_source").val();
$("#sb").css(sourceC);
});
});