I have a problem that I think will be very simple for you. I've done a preview of images and I need to remove each image separately, but I'm not getting it, I'm trying to get the id. The images are inside a div called output_box_photo. I created a counter to assign different id's for each image.
Here is the code below:
for(var i=0;i<total_file;i++)
{
// Only process image files.
if (!files_show[i].type.match('image.*')) {
continue;
}
$('#output_box_foto').append("<img class='thumb' id='"+contador_img+"' src='"+URL.createObjectURL(files_show[i])+"'><br/><span class='remove'>Remover</span>").on('click', function() {
id = $("#output_box_foto").find('img').attr('id');
alert(id);
});
}