Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>ex1.loops</title>
- </head>
- <body>
- <script>
- var num1 = parseFloat(prompt("enter a number between 1 and 10 (1 and 10 included)"));
- while(num1 > 10 || num1 < 1)
- {
- alert("The value entered is not valid. Please try again."+ num1);
- num1 = parseFloat(prompt("enter a number between 1 and 10 (1 and 10 included)"));
- }
- document.write("Thank you. The number you entered is "+num1+".");
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement