Need to do an operation when the file is changed or when we clear the file input.
$('input[type="file"]').change(function (e) {
console.log('changed')
});
It works when I select/change the file.
It doesn't trigger change event when I clear the input[type=file].
$('input[type="file"]').val('');
Does clearing the value triggers the change event? or what would be a better way to this?