JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" id="add" value="Add" />
<div id="container">
</div>
JavaScript
var count = 0;
$('#add').click(function(){
count++;
$('#container').append('<div class="section' + count + '">This is count ' + count + '. <input type="button" id="remove" value="Remove" /></div>');
});
$('#remove').click(function(){
var row = $(this).attr("class");
$(row).remove();
count--;
});