I have a simple html page with file input and a fontawesome icon I'm using as a button:
<div class="col" id="fileDivs">
<div class="block">
<input type="file" name="files" /><i class="fas fa-plus-circle text-success" id="addFileBtn"></i><br/>
</div>
</div>
The jquery code for adding a new button works fine
$("#addFileBtn").click(function(){
$('.block').after("<input type='file' name='files' /><i class='fas fa-minus-circle text-warning' id='removeFileBtn'></i>")
My problem is with the delete button that does not seem to do anything. (The alert is not even triggered)
$('#removeFileBtn').click(function(){
alert(this.id);
$(this).parent('.block').remove();
});
Any help is much appreciated