JSFiddle - React, Tailwind, and code Playground

by Reigel Gallarde

HTML

<a href="#">add</a>
<div id="box"></div>

JavaScript

$(function () {
    var counter = 0;

    $('a').click(function () {
        var elems = '<div>'+
              '<input type="checkbox" id="checkbox"' + (counter) + '" class="item"/>' + 
              '<input type="text" id="t1"' + (counter) + '"/>' +
              '<input type="button" class="removebtn" value="." id="removebtn"' + (counter) + '"/>' +
        '</div>';
        $('#box').append(elems);
        $("#box").append("br<br />");
        $("#box").append("br<br />");
        counter++;
        return false;
    });

    $('.removebtn').live('click',function () {
        $(this).parent().remove();   
    });
});