JS 动态给 CheckBoxList赋值~~~~~~~~
页面上有checkbox控件。
<asp:CheckBoxList ID="ckStampName" name="ckStampName" runat="server" RepeatDirection="Horizontal" RepeatColumns="4" RepeatLayout="Table"></asp:CheckBoxList>
在一段JS代码中,我要动态的给它赋值,请问如何写?网上找的代码如下,不对
function RadioStampClass_onchange() {
var check=document.createElement("input");
check.type= "checkbox";
check.value= "2222 ";
var list = document.getElementsByName("<%=ckStampName.UniqueID %>");
alert(list);
var row=list.insertRow();
var cell=row.insertCell();
cell.appendChild(check);
check.checked=true;
}