JSFiddle - React, Tailwind, and code Playground

by lbstr

HTML

<div id="container">
    <div id="box">
        <a href="javascript:write('clicked a');">a</a>
    </div>
    <div id="msgs"></div>
</div>

CSS

#container{height:500px; background-color:#f1f7ff;}
#box {margin:100px;padding:100px;background-color:#efe7e1;}

JavaScript

window.write = function(msg){
    var $msgs = write.$msgs || (write.$msgs = $('#msgs'));
    
    $msgs.append('<div>' + msg + '</div>');
}

$(function(){
    $('#box').click(function(){
        
    });
});