Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script>
- function ShowCitat()
- {
- var Citat = [
- 'Citat1 -Jova',
- 'Citat2 -Zmaj',
- 'Citat3 -Kockica',
- 'Citat4 -Makric',
- 'Citat5 -Krco',
- 'Citat6 -ja'
- ];
- var Pick = Math.floor(Math.random() * (Citat.length));
- document.write(Citat[Pick]);
- }
- document.addEventListener("load", ShowCitat());
- </script>
- <meta charset=utf-8 />
- <title>Luka Grujic </title>
- <style type="text/css">
- .card {
- width: 130px;
- height: 195px;
- position: relative;
- display: inline-block;
- }
- .card .img-top {
- display: none;
- position: absolute;
- top: 0;
- left: 0;
- z-index: 99;
- }
- .card:hover .img-top {
- display: inline;
- }
- body {margin: 30px;}
- </style>
- </head>
- <body>
- <div class="card">
- <img src="nekaslika.jpg" alt="Card Back">
- <img src="josneka.jpg" class="img-top" alt="Card Front">
- </div>
- <script>
- function updateBackground() {
- var
- hr = (new Date()).getHours(),
- body = document.body,
- bstyle = body.style,
- hello = document.querySelector(".hello");
- if (hr == 1,3,5,7,9,11,13,15,17,19,21,23) {
- bstyle.backgroundColor = "black";
- bstyle.color = "white";
- hello.innerText = "Have a good morning";
- } if (hr== 2,4,6,8,10,12,14,16,18,20,22,24) {
- bstyle.backgroundColor = "blue";
- bstyle.color = "green";
- hello.innerText = "Have a good night!";
- }
- }
- setInterval(updateBackground, 1000 * 60);
- updateBackground();
- </script>
- <form>
- Prvi broj : <input type="text" id="firstNumber" /><br>
- Drugi broj: <input type="text" id="secondNumber" /><br>
- <input type="button" onClick="multiplyBy()" Value="Multiply" />
- <input type="button" onClick="divideBy()" Value="Divide" />
- </form>
- <p>Rezultat : <br>
- <span id = "result"></span>
- </p>
- <script>
- function multiplyBy()
- {
- num1 = document.getElementById("firstNumber").value;
- num2 = document.getElementById("secondNumber").value;
- document.getElementById("result").innerHTML = num1 * num2;
- }
- function divideBy()
- {
- num1 = document.getElementById("firstNumber").value;
- num2 = document.getElementById("secondNumber").value;
- document.getElementById("result").innerHTML = num1 / num2;
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement