Answers for "jquery empty file input field"

6

jquery clear file input

//clear a file input with jQuery 
$("#myFileInputID").val(null);

//clear file input in plain Javascript
document.getElementById("myFileInputID").value = null;
Posted by: Guest on August-01-2019
0

How to check if input file is empty in jQuery

if ($('#videoUploadFile').get(0).files.length === 0) {
    console.log("No files selected.");
}
Posted by: Guest on May-01-2021

Code answers related to "jquery empty file input field"

Code answers related to "Javascript"

Browse Popular Code Answers by Language