Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type ="text/javascript">
- var add=null;
- function throw() {
- var artist = document.getElementById("artist").value;
- var title = document.getElementById("title").value;
- var label = document.getElementById("label").value;
- newRow = document.createElement("tr onclick='showRow(this)");
- newRow.innerHTML = "<td>" + artist + "</td>" + "<td>" + title + "</td>" + "<td>"
- + label + "</td>";
- add = document.getElementById("tabelkaa");
- add.appendChild(newRow);
- }
- function showRow(x) {
- alert("Row index is: " + x.rowIndex);
- }
- window.onload = function () {
- var plus = document.getElementById("plus");
- plus.addEventListener("click", throw);
- }
- </script>
- </head>
- <body>
- <div id="info">
- <p>Artist <input type ="text" id="artist"> </p>
- <p> Title <input type ="text" id="title"> </p>
- <p>Label <input type ="text" id="label"> </p>
- <input type="submit" value="-" id="minus">
- <input type="submit" value="+" id="plus"> <br/>
- </div>
- <div id ="tabelka">
- <table id="tabelkaa" border="5">
- </table>
- </div>
- </body>
Add Comment
Please, Sign In to add comment