JSFiddle - React, Tailwind, and code Playground

by zerolfc

HTML

<input type="text" class="textbox"><a href="#" class="add">Add</a> <br>
<div id="holder"></div>
<span></span>

CSS

body { cursor:pointer; }
span { color:red; }

JavaScript

$(".add").live("click", function() {
    var n = $("div.textbox").length;
    $("span").text("There are " + n + " divs." + "Click to add more.");
    
    var newTextBoxDiv = $(document.createElement('div')).attr("class", 'textbox');
     newTextBoxDiv.html('<input type="text">');
    
    
    newTextBoxDiv.appendTo("#holder");
    
    
    
}).trigger('click')