I would like the else part of the following if-statement to make that prompt pop up again. In other words, I want the prompt to come back if user writes something other than "yes" or "no".
var str = prompt("Do you want to come in?").toLowerCase();
if (srt === "yes"){
alert("cool.");
}
else if (str === "no"){
alert("goodbye.");
}
else {
var str = prompt("Do you want to come in?").toLowerCase();
}
Aucun commentaire:
Enregistrer un commentaire