JSFiddle - React, Tailwind, and code Playground
by skydivematy
HTML
<script src="https://code.jquery.com/jquery-2.2.0.min.js"></script>
<div class="rule" id="rule">
<div class="fm-req">
<select name="rulefield" id="rulefield">
<option value="">select</option>
<option value="">test</option>
</select>
</div>
<div class="fm-opt" >
<input type="button" class='remove' value="-" style="display:none;"/>
</div>
</div>
<div class="fm-rulebutton">
<input type="button" id="addButton "class='add' value="+"/>
</div>
<div id='TextBoxesGroup' class="group"><p>
test text
</p></div>
JavaScript
$('.add').click(function(){
id++;
var prot = $(document).find(".rule").clone();
prot.attr("class", 'rule'+id)
prot.children('.remove').show();
prot.find(".id").attr("value", id);
$(document).find("div .group").append(prot);
});