在一个gridview中有两列都是要实现复选框的全选功能。
问:怎么写,求帮助 谢谢

解决方案 »

  1.   


    function selectAllCheckBox(){
    var checkStatus=$("selectAllChk").checked;

    var arr=document.getElementsByTagName("input");

    for(var i=0;i<arr.length;i++){
    var type=arr[i].getAttribute("type");
    var id=arr[i].getAttribute("id");

    if(type=='checkbox' && id!='selectAllChk'){
    arr[i].checked=checkStatus;
    }
    }
    }
      

  2.   

    <input type="checkbox" id="selectAllChk" onclick="selectAllCheckBox()"/>