Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>conditional example: if, elseif </title>
- </head>
- <body>
- <script>
- var mark =parseFloat(prompt("enter a mark"));
- if (mark >= 75)
- {// if the condition above is true this will be exectued if its false the code between the next braces will be executed
- alert( "Very good work!");
- }
- else if (mark >= 65)
- {
- alert("Good work,");
- }
- else if (mark >= 60)
- {
- alert("satasfactory work");
- }
- else if (mark >= 50)
- {
- alert("work harder.");
- }
- else
- {
- alert("Mark is below 50%. You are not passing. ");
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment