I'm trying to make it so that I can exit this program with exit even if someone enters EXIT ExIt, EXit, etc. I tried putting it at the end of the var input at the beginning of the string and at the end of the string in the "}while" statement and it still not getting it to work. Does anyone know where I should put it?
<!DOCTYPE html>
<html>
<head>
<title>Project 1 – Michael Fiorello</title>
</head>
<body>
<h1>Robot Speak</h1>
<script>
do{
var input = prompt ("Please enter 1, 2, 3, or exit.");{
if (input == "1")
{
alert ("THANKS!")
}
else if (input == "2")
{
alert ("COOL!")
}
else if (input == "3")
{
alert ("AWESOME!")
}
else if (input == "exit")
{
alert ("Okay")
}
else
{
alert ("You need to enter something")
console.warn("You need to enter something");
}
}
}while(input != "exit")
</script>
</body>
</html>