Copy Table row to another table HTML
html, html-table, javascript
Solution
At your example it was a wrong selector
$('#myTable.tr')
instead of
$('#myTable tr')
Check fixed version: http://jsfiddle.net/V7wXD/7/
Best regards!
Problem
Fiddle I have two tables. When I click on one table row it will copy to another table, and I will change the button as my requirement. Please help me. ``` $(window).load(function() { var items = []; $(".addBtn").on("click", function() { var newTr = $(this).closest("tr").clone(); var newButtonHTML = "<input type = 'button' value='Edit' onclick='Edit()' /><input type='button' value='Delete' onclick='deleteRow(this.parentNode.parentNode.rowIndex)'/>"; $(newButtonHTML).children("button").click(function(e) { }); $(newTr).children("td:last").html("").html(newButtonHTML); items.push(newTr); newTr.appendTo($("#stopsTable")); }); ```