CheckBoxList用JS实现单元

JS实现单选                       

<script type="text/javascript">
  function CheckSelect() {

    //得到CheckBoxList 的ID

    var tb = document.getElementById("<%=cblHandleContent.ClientID%>");

    //循环得到CheckBoxList 的子集,并控制它的选中状态

    for (var i = 0; i < tb.cells.length; i++) {
      var chk = tb.cells[i].firstChild;
      if (chk != event.srcElement) {
        chk.checked = false;
        }
      }
 }
</script>

后台绑定好的服务器控件

<asp:CheckBoxList onclick="javascript:CheckSelect();" ID="cblHandleContent" RepeatDirection="Horizontal" runat="server" >
</asp:CheckBoxList>          

原文地址:https://www.cnblogs.com/zhumengmeng/p/4056368.html