Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <meta charset="UTF-8">
- </head>
- <body>
- Liczba 1 = <input type='text' id="licz1"></input>
- <br>
- Liczba 2 = <input type='text' id="licz2"></input>
- <br>
- Liczba 3 = <input type='text' id="licz3"></input>
- <br>
- <button id="przycisk" onclick="start()">ZROB TO</button>
- <button id="przycisk2" onclick="licz()">ZROB TO 2</button>
- <script>
- function start()
- {
- var licz1 = document.getElementById('licz1').value;
- var licz2 = document.getElementById('licz2').value;
- var wynik = document.getElementById('wynik');
- wynik.innerHTML = licz1 + licz2;
- }
- function licz()
- {
- var licz1 = document.getElementById('licz1').value;
- var licz2 = document.getElementById('licz2').value;
- var licz3 = document.getElementById('licz3').value;
- var wynik2 = document.getElementById('wynik2');
- for(var i=licz2; i>=licz1; i-=licz3)
- {
- wynik2.innerHTML+=i+" <br>";
- }
- }
- </script>
- <p id=wynik></p>
- <p id=wynik2></p>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement