I have a multiple file upload. I want to remove the selected index from the file list using jquery.
var x = document.getElementById("thumb");
$('body').on('click', 'a.cvf_delete_image', function (e) {
e.preventDefault();
$(this).parent().remove('');
var y =x.files;
var file = $(this).parent().attr('file');
for (var i = 0; i < storedFiles.length; i++) {
if (storedFiles[i].name == file) {
storedFiles.splice(i, 1);
y.splice(i, 1);
break;
}
}
// var actual_file = $("#thumb").files(storedFiles);
});
this is what I tried but y.splice(i, 1);
is not working