Advertisement
Guest User

zadatak

a guest
Nov 18th, 2019
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.61 KB | None | 0 0
  1. <html>
  2. <head>
  3.  
  4.  
  5. <script>
  6. function ShowCitat()
  7. {
  8. var Citat = [
  9. 'Citat1 -Jova',
  10. 'Citat2 -Zmaj',
  11. 'Citat3 -Kockica',
  12. 'Citat4 -Makric',
  13. 'Citat5 -Krco',
  14. 'Citat6 -ja'
  15. ];
  16. var Pick = Math.floor(Math.random() * (Citat.length));
  17. document.write(Citat[Pick]);
  18. }
  19.  
  20. document.addEventListener("load", ShowCitat());
  21. </script>
  22. <meta charset=utf-8 />
  23. <title>Luka Grujic </title>
  24. <style type="text/css">
  25. .card {
  26. width: 130px;
  27. height: 195px;
  28. position: relative;
  29. display: inline-block;
  30. }
  31. .card .img-top {
  32. display: none;
  33. position: absolute;
  34. top: 0;
  35. left: 0;
  36. z-index: 99;
  37. }
  38. .card:hover .img-top {
  39. display: inline;
  40. }
  41. body {margin: 30px;}
  42. </style>
  43. </head>
  44. <body>
  45. <div class="card">
  46. <img src="nekaslika.jpg" alt="Card Back">
  47. <img src="josneka.jpg" class="img-top" alt="Card Front">
  48. </div>
  49. <script>
  50. function updateBackground() {
  51. var
  52. hr = (new Date()).getHours(),
  53. body = document.body,
  54. bstyle = body.style,
  55. hello = document.querySelector(".hello");
  56. if (hr == 1,3,5,7,9,11,13,15,17,19,21,23) {
  57. bstyle.backgroundColor = "black";
  58. bstyle.color = "white";
  59. hello.innerText = "Have a good morning";
  60. } if (hr== 2,4,6,8,10,12,14,16,18,20,22,24) {
  61. bstyle.backgroundColor = "blue";
  62. bstyle.color = "green";
  63. hello.innerText = "Have a good night!";
  64. }
  65. }
  66.  
  67. setInterval(updateBackground, 1000 * 60);
  68. updateBackground();
  69.  
  70. </script>
  71.  
  72.  
  73. <form>
  74. Prvi broj : <input type="text" id="firstNumber" /><br>
  75. Drugi broj: <input type="text" id="secondNumber" /><br>
  76. <input type="button" onClick="multiplyBy()" Value="Multiply" />
  77. <input type="button" onClick="divideBy()" Value="Divide" />
  78. </form>
  79. <p>Rezultat : <br>
  80. <span id = "result"></span>
  81. </p>
  82. <script>
  83. function multiplyBy()
  84. {
  85. num1 = document.getElementById("firstNumber").value;
  86. num2 = document.getElementById("secondNumber").value;
  87. document.getElementById("result").innerHTML = num1 * num2;
  88. }
  89.  
  90. function divideBy()
  91. {
  92. num1 = document.getElementById("firstNumber").value;
  93. num2 = document.getElementById("secondNumber").value;
  94. document.getElementById("result").innerHTML = num1 / num2;
  95. }
  96. </script>
  97. </body>
  98. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement