2
我想用按钮附加一些元素。但他们必须有不同的ID。 我必须使用数组吗?像checkboxname [+ i]一样。 我使用javascript附加复选框列表需要数组吗?
在此先感谢
function append()
{
var cb = document.createElement("input");
cb.type = "checkbox";
cb.id = "id"
cb.checked = false;
var textfield = document.createElement("input");
var delbtn = document.createElement("input");
delbtn.type = "button";
delbtn.value = "remove";
delbtn.onclick= function(){remove()}
document.getElementById('append').appendChild(cb);
document.getElementById('append').appendChild(textfield);
document.getElementById('append').appendChild(delbtn);