//asks the user for a code letter then shows the manufacturing grade var userInput = prompt ("Please enter your code letter here:", ""); if (userInput == "S" || "s") { document.write("Your manufacturing grade is Space Grade"); } else if (userInput == "M" || "m") { document.write("Your manufacturing grade is Military Grade"); } else if (userInput == "C" || "c") { document.write("Your manufacturing grade is Commercial Grade"); } else (userInput == "T" || "t") { document.write("Your manufacturing grade is Toy Grade"); } PHP: every time I try putting it to work I get the result of the first one "Your manufacturing grade is Space Grade" any letter or number I put is the same. I need help on what I am doing wrong here.
Your condition clauses are incorrect. You should use something like: if ((userInput == "S") || (userInput == "s")) { Code (markup): and would be simpler if you used: if (userInput.toUpperCase() == "S") { Code (markup):