476179

conditionifnested

Nov 1st, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <title>if nested</title>
  6. </head>
  7.  
  8. <body>
  9. <script>
  10.  
  11. var m =parseFloat(prompt("What is the current bank balance?"));
  12.  
  13. if (m > 0 ) // this checks if there is a positive balance
  14. {
  15. document.write("The balance is positive.");
  16. if (m > 10000)
  17. {
  18. document.write("your balance is over $10,000");
  19. }
  20. else
  21. {
  22. document.write("your balance is less than or equal to $10,000");
  23. }
  24. }
  25. else
  26. {
  27. document.write("you do not have a positive balance.");
  28. }
  29.  
  30. </script>
  31. </body>
  32.  
  33. </html>
Advertisement
Add Comment
Please, Sign In to add comment