+ 2
What is wrong with this code?
Var day= prompt("Please Enter a number:", 1); Switch(day) { Case 1: Document.write("Monday"); Break; //other cases Default: Document.write("Another Day") ; } //It always does the default case instead of taking my input
2 Answers
+ 4
Remove those uppercase letters javascript is case sensitive
prompt() returns a string so you need to change the input to integer.
var day= parseInt(prompt("Please Enter a number:", 1));
- 1
what is ur input?! the "Please....." or 1 ?
u see where I'm going with?