I need some help with a javascript prompt meny:
This is the code I got:
Code:
while (true) {
var meny = prompt ("0. Exit" + '<br />' +"1. Fahrenheit to Celsius" + "<br />" + "2. Celsius to Fahrenheit" + "<br />" + "3. Guess Number", "");
if(meny == 0) {
alert("You will Exit");
break;
}
else if(meny == 1) {
alert("Fahrenheit to Celsius");
}
else if(meny == 2) {
alert("Celsius to Fahrenheit");
}
else if (meny == 3) {
alert( "Guess Number" );
}
else (meny > 3) {
var meny = prompt ("0. Exit" + '<br />' +"1. Fahrenheit to Celsius"+"<br />"+"2. Celsius to Fahrenheit"+"<br />"+"3. Guess Number", "");
}
I want it to work like this:
If the user types in "0" she should exit the meny.
If the user types in "1" a script would load that converts F to C.
Etc etc...
But at the moment the script doesnt work and I am completely lost. Advice and help is really needed!
Thanks!