How can I continue prompting a user for a valid response using if... else if statements? My script currently works once, but then breaks:
var enterNum = prompt("Please enter a number between 1 and 100", "");
if (isNaN(enterNum)){
enterNum = prompt("You did not enter a valid number. Please try again", "")
}
else if (enterNum < 1 || enterNum >100){
enterNum = prompt("Your number is not between 1 and 100. Please try again", "")
}
else{
document.write("Your number is ", enterNum)
}
Thanks in advance!