Advertisement
Guest User

My Code

a guest
Apr 19th, 2016
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <script>
  5.  
  6. var score = 1;
  7.  
  8. function ask(question, correct) {
  9. var answer=prompt(question);
  10. if(answer==correct){
  11. alert("Well Done, You got it right!"), score = score + 1;
  12. }
  13. else { alert("Sorry that is wrong");
  14. }
  15.  
  16. 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");
  17. ask(" Question 2:","d");
  18. ask(" Question 3:","d");
  19. ask(" Question 4:","d");
  20. ask(" Question 5:","d");
  21. ask(" Question 6:","d");
  22. ask(" Question 7:","d");
  23. ask(" Question 8:","d");
  24. ask(" Question 9:","d");
  25. ask(" Question 10:","d");
  26.  
  27. </script>
  28. </head>
  29. <body>
  30.  
  31. <h1> Congratulations you finished this quiz! </h1>
  32. <script>
  33. if (1 == 1)score = score - 1;
  34. document.getElementById("demo").innerHTML = "Your final score was " + score;
  35. </script>
  36.  
  37. </body>
  38. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement