|
|
palomares
regular
Reg'd: Thu
Posts: 36
|
Is there the equivalent of Goto in Javascript?
Fri Mar 18 2005 08:55 PM
|
|
|
Hi,
I am a complete beginner ,trying to learn some Javascript. I was asking myself if there is a command , like the Goto command in Basic. I remember:
10 bla bla 20 bla bla 30 if (Something) goto 10
Or if this is more helpful:
var number ;
number = prompt("Please enter a number"," ");
number = parseInt(number)
if (isNaN(number)) { document.write("This is not a number<br />"); document.write(" Please try again!"); } else { var result ;
result = 2*number ;
document.write("The number times two is = "+result); }
Just after the
"Please try again",..., I'd like to make it return to the first line, therefore asking the user to add another input,...
Could anybody point me in the right direction of a command which would do this? Many Thanks
|
|
|
|
|