Advertisement
Guest User

Untitled

a guest
Oct 24th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="utf-8">
  4. </head>
  5. <body>
  6. <br>
  7. Liczba <input id="input" type="text" value="">
  8.  
  9. <button onclick="myfunction()">Start</button>
  10.  
  11. <div id="kwadrat" style ="width: 100px; height; 100px; background-color: grey; margin-left: 47%;">
  12.  
  13. </div>
  14. <script>
  15.  
  16.  
  17. function mtFunction()
  18. {
  19. var kwadrat1 = document.getElementById("kwadrat1");
  20. var input = document.getElementById("input").value;
  21. kwadrat1.style.backgroound = "rgb("+random1+", "+random2+", "+ranodm3+")";
  22.  
  23. function myFunction()
  24. {
  25. var kwadrat1 = document.getElementById("kwadrat");
  26. var input1 = document.getElementById("input").value;
  27.  
  28. var random1 = Math.floor(Math.random() * 256);
  29. var random2 = Math.floor(Math.random() * 256);
  30. var random3 = Math.floor(Math.random() * 256);
  31. kwardat1.style.backgronudColor = "rgb("+random1+", "+random2+", "+random3+")";
  32.  
  33. }
  34. </script>
  35. <hr>
  36. </body>
  37. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement