Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <script>
- var score = 1;
- function ask(question, correct) {
- var answer=prompt(question);
- if(answer==correct){
- alert("Well Done, You got it right!"), score = score + 1;
- }
- else { alert("Sorry that is wrong");
- }
- ask(" Question 1: What is the name of the volcano that erupted? A: Mr volcano B: Mrs volcano C: The volcano D: Mnt Vesisvus","d");
- ask(" Question 2:","d");
- ask(" Question 3:","d");
- ask(" Question 4:","d");
- ask(" Question 5:","d");
- ask(" Question 6:","d");
- ask(" Question 7:","d");
- ask(" Question 8:","d");
- ask(" Question 9:","d");
- ask(" Question 10:","d");
- </script>
- </head>
- <body>
- <h1> Congratulations you finished this quiz! </h1>
- <script>
- if (1 == 1)score = score - 1;
- document.getElementById("demo").innerHTML = "Your final score was " + score;
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement