全选反选

function All(){
          var checkeds = document.getElementsByName("id[]");
          for(i = 0; i < checkeds.length; i++){
               checkeds[i].checked = true;
          }
     }
     function antiAll(){
          var selects = document.getElementsByName("id[]");
          for(i = 0; i < selects.length; i++){
               if(selects[i].checked == true){
                    selects[i].checked = false;
               }
               else{
                    selects[i].checked = true;
               }
          }
     }

posted on 2017-02-20 10:47  日光下的曼雪-正版  阅读(84)  评论(0编辑  收藏  举报

导航