476179

Matthew is a fucking idiot

Dec 19th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>ex1.loops</title>
  6. </head>
  7.  
  8. <body>
  9. <script>
  10. /*
  11. var num1 = parseFloat(prompt("enter a number between 1 and 10 (1 and 10 included)"));
  12.  
  13. while(num1 > 10 || num1 < 1)
  14. {
  15. document.write("The value entered is not valid. Please try again since" + num1 + " is not between 1 and 10");
  16. num1 = parseFloat(prompt("Enter a number between 1 and 10 (1 and 10 included)"));
  17. }
  18. document.write("Thank you! The number you entered, "+ num1 +" is between 1 and 10.");
  19. */
  20.  
  21.  
  22. var num = parseFloat(prompt("Please enter a number between one and ten!"));
  23.  
  24.  
  25.  
  26. while(num < 1 || num > 10)
  27. {
  28. alert("Sorry! The number you entered, " + num + ", is not between one and ten. Please try again!");
  29. }
  30.  
  31. alert("Thank you! The value you entered, " + num + ", is between one and ten!");
  32. </script>
  33. </body>
  34.  
  35. </html>
Add Comment
Please, Sign In to add comment