Advertisement
RokiAdhytama

Quiz - Chapter 11

Jul 3rd, 2022
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <html xmlns="http://www.w3.org/1999/xhtml">
  2. <head>
  3. <title>Online Quiz</title>
  4.  
  5. <script type="text/JavaScript">
  6.  
  7. function checkAnswers()
  8. {
  9. // determine whether the answer is correct
  10. if ( myQuiz.radiobutton[1].checked )
  11. document.write( "Congratulations, your answer is correct" );
  12. else // if the answer is incorrect
  13. document.write( "Your answer is incorrect. Please try again" );
  14. }
  15.  
  16. </script>
  17.  
  18. </head>
  19.  
  20. <body>
  21. <form id="myQuiz" action="JavaScript:checkAnswers()">
  22. <p>Select the name of the tip that goes with the image shown:<br />
  23. <img src="EPT.gif" width="108" height="100" alt="mystery tip"/>
  24. <br />
  25.  
  26. <input type="radio" name="radiobutton" value="CPE" />
  27. <label>Common Programming Error</label>
  28.  
  29. <input type="radio" name="radiobutton" value="EPT" />
  30. <label>Error-Prevention Tip</label>
  31.  
  32. <input type="radio" name="radiobutton" value="PERF" />
  33. <label>Performance Tip</label>
  34.  
  35. <input type="radio" name="radiobutton" value="PORT" />
  36. <label>Portability Tip</label><br />
  37.  
  38. <input type="submit" name="submit" value="Submit" />
  39. <input type="reset" name="reset" value="Reset" />
  40. </p>
  41. </form>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement