Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="UTF-8"/>
- </head>
- <script>
- function tak()
- {
- var liczbaA=document.getElementById('licz1').value;
- var liczbaB=document.getElementById('licz2').value;
- if(parseInt(liczbaA)<=parseInt(liczbaB))
- {
- for (x=parseInt(liczbaA);x<=parseInt(liczbaB);x++)
- document.getElementById(target_id).innerHTML+=x+",";
- }
- else
- {
- for (x=parseInt(liczbaA);x>=parseInt(liczbaB);x--)
- document.getElementById(target_id).innerHTML+=x+",";
- }
- };
- </script>
- <body>
- Liczba I:<input type="value" id="licz1"/>
- Liczba II:<input type="value" id="licz2"/>
- <input type="button" value="SPRAWDŹ" onclick="tak()"/>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement