I am trying to hide and delete image, this is the append code after upload
Append code
$('#uploaded_images').append('<div class="container uploaded_image"> <input type="text" value="'+data['result']+'" name="uploaded_image_name[]" id="uploaded_image_name" hidden> <img class="img-thumbnail" width="200" height="200" src="server/uploads/'+data['result']+'" /> <a id="delete" href="index.php?image='+data['result']+'" class="btn btn-danger">'+data['result']+'</a> </div>');
Hide code
$('body').on('click', '#delete', function() {
// code here
$(this).hide();
});
For some reason $(this).hide();
it's not working
I also would like to send a GET request to delete.php?image=+data['result']+ to delete the image from files.
Does somebody have a solution?