Advertisement
Guest User

Untitled

a guest
Sep 16th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta charset="UTF-8">
  4. </head>
  5. <body>
  6. Liczba 1 = <input type='text' id="licz1"></input>
  7. <br>
  8. Liczba 2 = <input type='text' id="licz2"></input>
  9. <br>
  10. Liczba 3 = <input type='text' id="licz3"></input>
  11.  
  12. <br>
  13. <button id="przycisk" onclick="start()">ZROB TO</button>
  14.  
  15. <button id="przycisk2" onclick="licz()">ZROB TO 2</button>
  16.  
  17. <script>
  18.  
  19. function start()
  20. {
  21. var licz1 = document.getElementById('licz1').value;
  22. var licz2 = document.getElementById('licz2').value;
  23. var wynik = document.getElementById('wynik');
  24. wynik.innerHTML = licz1 + licz2;
  25. }
  26.  
  27. function licz()
  28. {
  29. var licz1 = document.getElementById('licz1').value;
  30. var licz2 = document.getElementById('licz2').value;
  31. var licz3 = document.getElementById('licz3').value;
  32. var wynik2 = document.getElementById('wynik2');
  33.  
  34. for(var i=licz2; i>=licz1; i-=licz3)
  35. {
  36. wynik2.innerHTML+=i+" <br>";
  37. }
  38.  
  39.  
  40.  
  41. }
  42.  
  43.  
  44.  
  45.  
  46. </script>
  47. <p id=wynik></p>
  48. <p id=wynik2></p>
  49.  
  50. </body>
  51. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement