zss1100
爱就要负责

function CheckAll()
{
   var AllCKBox = document.getElementsByTagName("input");
   var CKBox1 = document.getElementById("CheckBox1");
   if(CKBox1.checked==true){
   for (var i=0; i<AllCKBox.length; i++)
      if (AllCKBox[i].type == "checkbox") AllCKBox[i].checked = true;
   }
   else
   {
   for (var i=0; i<allcheckbox.length; i++)
      if (AllCKBox[i].type == "checkbox") AllCKBox[i].checked = false;
   }

<asp:CheckBox id="CheckBox1" runat="server"  onclick="CheckAll()"></asp:CheckBox>

posted on 2007-03-04 15:31  打你鸟鸟头  阅读(374)  评论(1编辑  收藏  举报