I'm generating fields dynamically but I need to add a id in the middle of the string that will be the input.
var id = uid();
$(wrapper).after('<div> <input class="form-control" type="text"name="mytext[]"/>').after('<a href="#" class="remove_field">Remove</a></div>');
But it only works if the after is used in the final of enclose tag.
$(wrapper).after('<div> <input class="form-control" value="'+id+'" type="text" name="mytext[]"/><a href="#" class="remove_field">Remove</a></div>');