Javascript If statement used to check file extensions not working
问题 I have a form in which people can enter file paths. I want to make sure that the paths they are entering point to pictures so here is what I thought would work. function checkExt() { var extension= /* I know that the code to cut the extension off of the file is working correctly so for now let's just go with it ok */ if(extension!="jpg" || "gif" || "bmp" || "png" || "whatever else") alert("The file extension you have entered is not supported"); } But this does not work. I have tracked it down