function chek( chkAll )
??? {
??????? var obj = document.aspnetForm.getElementsByTagName(“input”);
?? ??? ??? ?
?? ??? ??? ?for (var i=0;i<obj.length;i++)
?? ??? ??? ?{
?? ??? ??? ?
?? ??? ??? ??? ?var e = obj[i];
?? ??? ??? ??? ?if (e.id.indexOf(“chkItem”)>=0 && e.type==”checkbox”)
?? ??? ??? ??? ??? ?e.checked = chkAll.checked;
?? ??? ??? ?}
?? ??? ??? ?
??? }
头部:
? <input type=”checkbox” id=”chkAll” onclick=”CheckAll( this );” />
子项:
<asp:CheckBox ID=”chkItem” runat=”server” />