Guest User

Untitled

a guest
Nov 21st, 2018
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
  2.  
  3. <html>
  4. <head>
  5.  
  6. <style type="text/css">
  7.  
  8. body {
  9. background-color: aqua;
  10. }
  11.  
  12. </style>
  13.  
  14. <title></title>
  15. </head>
  16.  
  17. <body>
  18. <h1>CIS 2450 Lab 04 And more JavaScript.</h1>
  19.  
  20. <p>Click on an image to see if you guessed correctly. The image will return white if you did, or red if you did not.</p>
  21.  
  22.  
  23. <script type="text/javascript">
  24.  
  25. function myFunction(arg1, arg2, arg3){
  26.  
  27. document.getElementById(arg1).style.backgroundColor = arg3;
  28.  
  29. document.getElementById(arg1).alert(arg2);
  30.  
  31. }
  32. </script>
  33.  
  34. <table border="1">
  35. <tr>
  36. <td><a href=""><img src="groucho.gif" width="150" height="150" alt="groucho" id="groucho" onclick="return myfunction('groucho', 'Incorrect', 'purple');"></a></td>
  37.  
  38. <td><a href=""><img src="keaton.gif" width="150" height="150" alt="keaton" id="keaton" onclick="return myfunction('keaton', 'Correct', 'red');"></a></td>
  39.  
  40. <td><a href=""><img src="kmarx.gif" width="150" height="150" alt="kmarx" id="kmarx" onclick="return myfunction('kmarx', 'Correct', 'red');"></a></td>
  41. </tr>
  42.  
  43. <tr>
  44. <td><a href=""><img src="darwin.gif" width="150" height="150" alt="darwin" id="darwin" onclick="return myfunction('darwin', 'Correct', 'red');"></a></td>
  45.  
  46. <td><a href=""><img src="poe.gif" width="150" height="150" alt="poe" id="poe" onclick="return myfunction('poe', 'Incorrect', 'purple');"></a></td>
  47.  
  48. <td><a href=""><img src="einstein.gif" width="150" height="150" alt="einstein" id="einstein" onclick="return myfunction('einstein', 'Correct', 'red');"></a></td>
  49. </tr>
  50. </table>
  51. </body>
  52. </html>
Add Comment
Please, Sign In to add comment