Advertisement
Guest User

Untitled

a guest
May 25th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <!doctype html>
  2. <html lang="pl">
  3. <head>
  4. <title>Lista</title>
  5. <meta charset="utf-8">
  6. <link rel="stylesheet" href="styles.css">
  7. </head>
  8.  
  9. <body>
  10. <ul id="lista"></ul>
  11.  
  12. <script>
  13. for (let i = 1; i <= 15; i++) {
  14. if(i%3===0 && i%5===0){
  15. output = 'podzielna przez 3 i 5'
  16. }
  17. else if(i%3===0){
  18. output = 'podzielna przez 3'
  19. }
  20. else if(i%5===0){
  21. output = 'podzielna przez 5'
  22. }
  23. else
  24. output = i;
  25.  
  26. document.getElementById("lista");
  27. const el = document.createElement('li');
  28. el.append(output);
  29. lista.appendChild(el);
  30. }
  31.  
  32. </script>
  33. <article id="footer">
  34. <a href="index.html" title="powrot">Powrót</a>
  35. </article>
  36.  
  37.  
  38. </body>
  39. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement