我有兩個表。當我點擊一個表格行時,它會複製到另一個表格,我將按照我的要求更改該按鈕。請幫幫我。
$(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"));
});
。爲什麼你放置$ sign – chandu