Programming Tips - javaScript: clear an html file input

Date: 2021dec17 Language: javaScript Q. javaScript: clear an html file input A. For obvious security reasons you can not set it to an arbitrary value. But you can clear it... jQuery:
$('#myfile).val(null);
Plain javaScript:
document.getElementById('myfile').value = null;
Assuming you have:
<input type='file' id='myfile'>