1、脚本
function chkAll(treeID)
    {
        //debugger;
        var chkall= document.getElementById("chkall");
        var chkother= document.getElementsByTagName("input");
        for (var i=0;i<chkother.length;i++)
        {
            if( chkother[i].type=='checkbox')
            {
                if(chkother[i].id.indexOf(treeID)>-1)
                {
                    if(chkall.checked==true)
                    {
                        chkother[i].checked=chkall.checked;
                    }
                }
            }
        }
    }

2、添加一个全选按钮
<input >红色地方为关键地方

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2022-02-12
  • 2021-12-30
猜你喜欢
  • 2022-01-30
  • 2022-12-23
  • 2021-10-31
  • 2021-07-16
  • 2022-01-20
  • 2021-10-10
相关资源
相似解决方案