單擊某一行中的複製鏈接時,我需要創建另一行並將其所有內容複製到新行。這是我有的代碼:無法複製單元值
addNewInlineRow(sid, idToUse); // this creates a new row with empty values
//this copies the value from old row to new row
$("#"+rowId+ " td").each(function(index){
$("#"+idToUse+ " td").get(index).text($(this).text());
});
但是這段代碼不起作用。有什麼建議麼?由於存在用於創建TR ID的複雜邏輯,我無法克隆整個TR!
你試過克隆TR? –