我有两张 table 。当我点击一个表格行时,它会复制到另一个表格,我会根据我的要求更改按钮。请帮我。
$(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"));
});
最佳答案
关于javascript - 将表格行复制到另一个表格 HTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23757096/