1
我需要重新和我的模板DIV追加到按鈕單擊父DIV,這是可以做到多次附加元素使用jQuery選擇
<div id = "parent">
<div id = "child_1">
<div><input type = "text"></div>
<div><input type = "text"></div>
//several inputs and divs
</div>
</div>
和我的腳本
//on button click event
var template = $("#parent").children().last();
template.attr("id","child_2"); //just a sample of dynamic id
$("#parent").append(template);
但這不工作
感謝,工作只是我希望它的方式 – natsu1627