Advertisement
niske

digitalni sat

Feb 13th, 2023
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Digitalni sat</title>
  4.  
  5. </head>
  6. <body>
  7.  
  8.  
  9.  
  10.  
  11. <script>
  12.  
  13. function displayTime() {
  14. let currentTime = new Date();
  15. let hours = currentTime.getHours();
  16. let minutes = currentTime.getMinutes();
  17. let seconds = currentTime.getSeconds();
  18. document.getElementById("time").innerHTML = hours + ":" + minutes + ":" + seconds;
  19. }
  20. setInterval(displayTime, 1000);
  21.  
  22. </script>
  23.  
  24. <div id="time"></div>
  25.  
  26. </body>
  27. </html>
  28.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement