Advertisement
Guest User

adadsdsa

a guest
Jan 19th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. <!DOCTYPE html>
  2.  
  3. <html>
  4. <head>
  5. <style>
  6. p{
  7. font-size:50px;
  8. font-weight:bold;
  9. }
  10. </style>
  11. </head>
  12. <body>
  13. <p style="border:2px solid red">
  14. <span id="prvoto">1</span>
  15. <span id="vtoroto">2</span>
  16. <span id="tretoto">3</span>
  17. <span id="cetvrtoto">4</span>
  18. <span id="petoto">5</span>
  19. <span id="sestoto">6</span>
  20. <span id="sedmoto">7</span>
  21. </p>
  22. <button onclick="funkcija()">START</button>
  23.  
  24. <script>
  25. function funkcija(){
  26. document.getElementById("prvoto").innerHTML=Math.ceil(Math.random() * 10);
  27. setTimeout(function(){ document.getElementById("vtoroto").innerHTML=Math.ceil(Math.random() * 10); }, 500);
  28. setTimeout(function(){ document.getElementById("tretoto").innerHTML=Math.ceil(Math.random() * 10); }, 1000);
  29. setTimeout(function(){ document.getElementById("cetvrtoto").innerHTML=Math.ceil(Math.random() * 10); }, 1500);
  30. setTimeout(function(){ document.getElementById("petoto").innerHTML=Math.ceil(Math.random() * 10); }, 2000);
  31. setTimeout(function(){ document.getElementById("sestoto").innerHTML=Math.ceil(Math.random() * 10); }, 2500);
  32. setTimeout(function(){ document.getElementById("sedmoto").innerHTML=Math.ceil(Math.random() * 10); }, 3000);
  33. }
  34. </script>
  35. </body>
  36. </html>
  37. so mi ja resi toj od Stiv
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement