0
I have this function to generate fields dynamically, as I can by a generated field limit.
$(function () {
var scntDiv = $('#dynamicDiv');
$(document).on('click', '#addInput', function () {
$('<p>' +
'<input type="text" id="inputeste" name="beneficio[]" class="form-control" placeholder="Adicionar beneficio" /> ' +
'<a class="btn btn-danger btn-sm" href="javascript:void(0)" id="remInput">' +
'<span class="glyphicon glyphicon-minus " aria-hidden="true"></span> ' +
'Remover beneficio' +
'</a>' +
'</p>').appendTo(scntDiv);
return false;
});
$(document).on('click', '#remInput', function () {
$(this).parents('p').remove();
return false;
});
});
Thanks was exactly that.
– fabricio