【发布时间】:2017-01-02 03:44:47
【问题描述】:
我有两张桌子。当我单击一个表格行时,它将复制到另一个表格,我将根据我的要求更改按钮。请帮我。
$(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"));
});
【问题讨论】:
-
您没有正确使用 Jquery。你为什么放 $ 符号
标签: javascript html html-table