Advertisement
Guest User

Untitled

a guest
May 26th, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. QUIZ
  2.  
  3. <script>
  4. function check() {
  5. var answer1, answer2, answer3, text;
  6.  
  7. // Get the value of the input field with id="numb"
  8. answer1 = document.getElementById("answer1").value;
  9. answer2 = document.getElementById("answer2").value;
  10.  
  11. // If x is Not a Number or less than one or greater than 10
  12. if (/*isNaN(answer1)*/answer1!="four" && answer1!="Four" && answer1!=4) {
  13. text = "Incorrect";
  14. text = text.fontcolor("red");
  15. } else {
  16. text = "Correct";
  17. text = text.fontcolor("green");
  18. }
  19. document.getElementById("correct1").innerHTML = text;
  20.  
  21. if (answer2!="Australia" && answer2!="australia") {
  22. text = "Incorrect";
  23. text = text.fontcolor("red");
  24. } else {
  25. text = "Correct";
  26. text = text.fontcolor("green");
  27. }
  28. document.getElementById("correct2").innerHTML = text;
  29. }
  30. </script>
  31.  
  32.  
  33. ZEGAR
  34.  
  35. <script>
  36. function startTime() {
  37. var today = new Date();
  38. var month = new Array();
  39. month[0] = "January";
  40. month[1] = "February";
  41. month[2] = "March";
  42. month[3] = "April";
  43. month[4] = "May";
  44. month[5] = "June";
  45. month[6] = "July";
  46. month[7] = "August";
  47. month[8] = "September";
  48. month[9] = "October";
  49. month[10] = "November";
  50. month[11] = "December";
  51. var h = today.getHours();
  52. var m = today.getMinutes();
  53. var s = today.getSeconds();
  54. h = checkTime(h);
  55. m = checkTime(m);
  56. s = checkTime(s);
  57. document.getElementById('time').innerHTML =
  58. h + ":" + m + ":" + s + " " + month[today.getMonth()] + " " + today.getDay();
  59. var t = setTimeout(startTime, 500);
  60. }
  61. function checkTime(i) {
  62. if (i < 10) {i = "0" + i};
  63. return i;
  64. }
  65. </script>
  66.  
  67. <body onload="startTime()">
  68. <p id="time"></p>
  69.  
  70. EFEKTY
  71.  
  72. <script>
  73. var x = 0;
  74. var sound = new Audio("https://www.myinstants.com/media/sounds/and-his-name-is-john-cena-1.mp3");
  75. function areYou() {
  76. if (x != 0) {
  77. //document.getElementById("name").innerHTML = x;
  78. document.body.style.backgroundImage = "url('background.jpg')";
  79. document.body.style.backgroundSize = "3008px";
  80. document.getElementById("container").style["opacity"] = "1";
  81. sound.pause();
  82. x = 0;
  83. }
  84. else {
  85. document.body.style.backgroundImage = "url('http://cdn.makeagif.com/media/8-27-2015/edWylV.gif')";
  86. document.body.style.backgroundSize = "100%";
  87. document.getElementById("container").style["opacity"] = "0";
  88. sound.currentTime = 1.5;
  89. sound.play();
  90. x = 1;
  91. }
  92. }
  93. </script>
  94. <button style="margin: 5px;" onClick="areYou()">On/Off</button>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement