input type file empty jquery code example
Example 1: jquery clear file input
//clear a file input with jQuery
$("#myFileInputID").val(null);
//clear file input in plain Javascript
document.getElementById("myFileInputID").value = null;
Example 2: How to check if input file is empty in jQuery
if ($('#videoUploadFile').get(0).files.length === 0) {
console.log("No files selected.");
}