<script type="text/javascript">
var fileType = prompt("Enter the image file type.");
function typeCheck(){
if (fileType == ".jpg" || fileType == ".img" || fileType == ".png"){ //This checks if the file is a jpg OR img OR png
alert("File type accepted!");
} else { //This alert is displayed if the file type is anything else
alert("Wrong file type!");
}
}
</script>