zoukankan      html  css  js  c++  java
  • JS全选与取消

    var checkFlag = true;
        function ChooseAll()
        {
           //if( !document.all("CheckAll").Checked ) // 全选 
           if( checkFlag ) // 全选 
          {
              var inputs = document.all.tags("INPUT");
              for (var i=0; i < inputs.length; i++) // 遍历页面上所有的 input
              {
                if (inputs[i].type == "checkbox" && inputs[i].id != "CheckAll" )
                 {
                    inputs[i].checked = true;
                 }    
              }
              checkFlag = false;
           }
           else  // 取消全选
           {
              var inputs = document.all.tags("INPUT");
              for (var i=0; i < inputs.length; i++) // 遍历页面上所有的 input
              {
                 if (inputs[i].type == "checkbox" && inputs[i].id != "CheckAll" )
                 {
                    inputs[i].checked = false;
                 }    
              }
              checkFlag = true;
           }
        }
  • 相关阅读:
    hdu-4283 You Are the One 区间dp,
    HDU
    HDU
    HDU
    SPOJ
    UESTC
    CodeForces
    HDU
    Git中文书籍
    zeng studio的项目窗口PHP Explorer
  • 原文地址:https://www.cnblogs.com/liufei88866/p/960273.html
Copyright © 2011-2022 走看看