JSFiddle - React, Tailwind, and code Playground

by hephistocles

HTML

<div class="branch">
<div class="node"><div class="leaf"><div class="leaf">        
    </div>

CSS

.branch {
 width:30px;
height:30px;
 background-color:#F66;   
}

JavaScript

function branch() {
    // prompt for new value for this branch node
    var newVal = prompt("Enter value for this box");   
    if (newVal.length > 0) {
        // create new subnodes 
    } else {
alert("nothing");        
    }        
    $(this).html(test);
}

$(".branch").click(branch);