Advertisement
niske

Untitled

Mar 23rd, 2023
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <title>Imena prezimena i godine</title>
  8. </head>
  9. <body>
  10. <form id="form">
  11. <label>IME:</label>
  12. <input type="text" id="ime"><br><br>
  13.  
  14. <label>PREZIME:</label>
  15. <input type="text" id="prezime"><br><br><br>
  16.  
  17. <label>GODINE:</label>
  18. <input type="number" id="godine"><br><br>
  19. <button type="button" id="kreiraj">Ispisi ime</button> <br>
  20. <textarea id="spisak" cols="100" rows="30"></textarea>
  21.  
  22.  
  23.  
  24. </form>
  25.  
  26. <script>
  27.  
  28. let ime = document.getElementById("ime");
  29. let prezime = document.getElementById("prezime");
  30. let godine = document.getElementById("godine")
  31. let kreiraj = document.getElementById("kreiraj");
  32. let spisak = document.getElementById("spisak");
  33.  
  34. function dodajIspis(){
  35.  
  36. let ispis = "Vi ste " + ime.value + " " + prezime.value + " i imate " + godine.value + " godina" ;
  37. spisak.value += ispis + "\n";
  38. ime.value = "";
  39. prezime.value = "";
  40. }
  41.  
  42. kreiraj.addEventListener("click", dodajIspis);
  43. </script>
  44. </body>
  45. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement