Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2019
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. function clock()
  2. {
  3. window.setInterval(dateUpdate, 1000);
  4.  
  5. function dateUpdate()
  6. {
  7. var date = new Date();
  8. var dateLocate = date.toLocaleString()
  9. var paragraph = window.document.querySelector("#data");
  10. paragraph.textContent = dateLocate;
  11. }
  12. }
  13.  
  14. window.addEventListener("load", clock);
  15.  
  16. function clock()
  17. {
  18. var date = new Date();
  19. var dateLocate = date.toLocaleString()
  20. var paragraph = window.document.querySelector("#data");
  21.  
  22. window.setInterval(dateUpdate, 1000);
  23.  
  24. function dateUpdate()
  25. {
  26. paragraph.textContent = dateLocate;
  27. }
  28. }
  29.  
  30. window.addEventListener("load", clock);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement