WordPress企业主题定制/开发/优化

选中或者取消全部复选框JS代码

首页 » 精选JS » 选中或者取消全部复选框JS代码
<script language="javascript">
 //第一次单击时的状态:
 var zt=true;
function mm()
{
 if(zt==true){zt=false;}else{zt=true;}
   var a = document.getElementsByTagName("input");
   for (var i=0; i<a.length; i++)  if (a[i].type == "checkbox") a[i].checked = zt;
}
</script>

<form id="form1" name="form1" method="post" action="">
  <input type="button" name="button" id="button" value="单击此处" onclick="mm()" />
  <input type="checkbox" name="checkbox" id="checkbox" />
  <input type="checkbox" name="checkbox2" id="checkbox2" />
  <input type="checkbox" name="checkbox3" id="checkbox3" />
  <input type="checkbox" name="checkbox4" id="checkbox4" />
  <input type="checkbox" name="checkbox5" id="checkbox5" />
  <input type="checkbox" name="checkbox6" id="checkbox6" />
  <input type="checkbox" name="checkbox7" id="checkbox7" />
  <input type="checkbox" name="checkbox8" id="checkbox8" />
  <input type="checkbox" name="checkbox9" id="checkbox9" />
  <input type="checkbox" name="checkbox10" id="checkbox10" />
  <input type="checkbox" name="checkbox11" id="checkbox11" />
  <input type="checkbox" name="checkbox12" id="checkbox12" />
  <input type="checkbox" name="checkbox13" id="checkbox13" />
  <input type="checkbox" name="checkbox14" id="checkbox14" />
  <input type="checkbox" name="checkbox15" id="checkbox15" />
  <input type="checkbox" name="checkbox16" id="checkbox16" />
  <input type="checkbox" name="checkbox17" id="checkbox17" />
</form>
分类与标签:

精选JS

相关项目

  • WordPress外贸企业主题

  • 最近更新

  • 热门标签