There is nothing in standard input control by which you can achieve it.
Yes there is an "accept"
attribute on file input controls, where you can specify the types of files you want but this is not recognized by many browsers. So the best you can do is check the file name (extension) of file selected by user using Javascript or Jquery.
function ValidateFile() {
var fileName = document.getElementById("inputFileId").value
if (fileName == "") {
alert("upload a valid File with .htm extension");
return false;
}
else if (fileName.split(".")[1].toUpperCase() == "HTM")
return true;
else {
alert("Invalid File");
return false;
}
return true;
}
But there's nothing preventing the user from renaming an executable to .html
for example.