JSFiddle - React, Tailwind, and code Playground

by vrpruthvi

HTML

<input type="text" id="cmt"><input type="button" value="Go" id="btn"><br>
<div class="test"></div>

CSS

.test{
    width:200px;
    height:200px;
    border:1px solid red;
}
.test1{
    position:relative;
    width:200px;
    height:20px;
    border:1px solid blue;
}

JavaScript

$(document).ready(function(){
    $("#cmt").val("Demo");
    $("#btn").click(function(){
        var dom=$("<div class='test1'></div>");
        dom.html($("#cmt").val());
        $(".test").append(dom);
    });
});