日期:2014-05-18 浏览次数:20517 次
<html> <head runat="server"> <title>无标题页</title> <script language="javascript" type="text/javascript"> function visi() { var checklist = document.getElementById('CheckBoxList1'); checklist.disabled = false; var spans = checklist.getElementsByTagName('span'); var inputchecks = checklist.getElementsByTagName('input'); for(var i = 0 ; i < spans.length ; i++) { spans[i].disabled=false; inputchecks[i].disabled=false; } } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:CheckBoxList ID="CheckBoxList1" runat="server"> <asp:ListItem>1</asp:ListItem> <asp:ListItem>2</asp:ListItem> <asp:ListItem>3</asp:ListItem> </asp:CheckBoxList> <button onclick="visi();">onclick</button> </div> </form> </body> </html>