Everything is in the title: how can I check if a file is loaded to <input type="file">
?
<input type="file" id="document-file" />
<input type="submit" id="document-send" />
<script type="text/javascript">
$('#document-send').click(function(event){
event.preventDefault();
var files = $("#document-file");
console.log(files.length);
}
</script>
files.length
always returns me 1
even if no file is loaded.