Advertisement
Guest User

Untitled

a guest
Apr 25th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. </head>
  6. <script>
  7. function ciklus()
  8. {
  9. var a=parseInt(document.getElementById("sz1").value);
  10. var b=parseInt(document.getElementById("sz2").value);
  11. var c=parseInt(document.getElementById("sz3").value);
  12. var t=""
  13. for (var i=a; i<=b; i=i+c)
  14.  
  15. t+= i +". " +"<br>";
  16. document.getElementById("tartalom").innerHTML=t;
  17. }
  18. </script>
  19. <body>
  20. Mettől:<BR>
  21. <input type="text" id="sz1"><BR>
  22. Meddig:<BR>
  23. <input type="text" id="sz2"><BR>
  24. Mennyivel:<BR>
  25. <input type="text" id="sz3"><BR>
  26. <button onclick="ciklus()">Végrehajt</button><BR>
  27. Tartalom:<BR>
  28. <p id="tartalom">
  29.  
  30. </p>
  31. </body>
  32. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement