以下のコードは、新しいボタンがクリックされるたびにこのコードが実行され、.table_product_list テーブルの最初の行が複製されることを示していますが、入力ボックスの ID と名前のみが増加します。
このコードを微調整してテキスト領域を追加する方法は?
var i=1;
$(".table_product_list tr:first").clone().find("input").each(function() {
$(this).attr({
'id': function(_, id) { return id + i },
'name': function(_, name) { return name + i },
'value': ''
});
}).end().appendTo(".table_product_list");
i++;