JSFiddle - React, Tailwind, and code Playground
HTML
<div id="main">
<a id="add-input" href="#">+ add</a>
<p class="child">
<input type="text" name="user[]" />
</p>
</div>
CSS
#main {width:400px;margin:30px auto}
JavaScript
var clonedField = $('.child').clone(),
main = $('#main');
$('<a/>', {
text: 'delete',
class: 'icon-delete',
href: '#',
click: function() {
$(this).parent().remove();
return false;
}
}).appendTo(clonedField);
$('#add-input').click(function() {
main.append(clonedField.clone(true));
return false;
});