Try this.....

Im not that good with Javascript, but this might work...

Instead of using a While condition, use an IF ELSE statement, so you have:

IF (userNumber >= upperLimit)
{
UserInput = window.prompt('Please re-enter - number should be in range 1 to + upperLimit, '')

userInput = window.prompt('Please enter a number in the range 1 to ' + upperLimit,'');
userNumber = parseFloat(userInput);
}
ELSE
{
document.write(''+'Your chosen number was ' + yourNumber)
}

Posted By: Trent_Canary, May 27, 14:22:41

Follow Ups

Reply to Message

Log in


Written & Designed By Ben Graves 1999-2025