Below is part of the jquery code I have which displays the file input and a \"Clear File\" button.
var $imagefile = $(\'\').attr({ type: \
Clear file input with jQuery
$("#fileInputId").val(null);
Clear file input with JavaScript
document.getElementById("fileInputId").value = null;