Guest User

Untitled

a guest
Jan 17th, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. <html>
  2. <head>
  3. <script type ="text/javascript">
  4. var add=null;
  5.  
  6. function throw() {
  7. var artist = document.getElementById("artist").value;
  8. var title = document.getElementById("title").value;
  9. var label = document.getElementById("label").value;
  10.  
  11. newRow = document.createElement("tr onclick='showRow(this)");
  12. newRow.innerHTML = "<td>" + artist + "</td>" + "<td>" + title + "</td>" + "<td>"
  13. + label + "</td>";
  14. add = document.getElementById("tabelkaa");
  15. add.appendChild(newRow);
  16. }
  17. function showRow(x) {
  18. alert("Row index is: " + x.rowIndex);
  19. }
  20. window.onload = function () {
  21. var plus = document.getElementById("plus");
  22. plus.addEventListener("click", throw);
  23. }
  24. </script>
  25.  
  26. </head>
  27. <body>
  28. <div id="info">
  29. <p>Artist <input type ="text" id="artist"> </p>
  30. <p> Title <input type ="text" id="title"> </p>
  31. <p>Label <input type ="text" id="label"> </p>
  32.  
  33. <input type="submit" value="-" id="minus">
  34. <input type="submit" value="+" id="plus"> <br/>
  35. </div>
  36. <div id ="tabelka">
  37. <table id="tabelkaa" border="5">
  38. </table>
  39. </div>
  40. </body>
Add Comment
Please, Sign In to add comment