»
EnglishFrenchVietnamese

Print - Check All Toggle Switch - JavaScriptBank.com

Full version: jsB@nk » Form » Checkbox » Check All Toggle Switch
URL: https://www.javascriptbank.com/check-all-toggle-switch.html

Check All Toggle Switch © JavaScriptBank.comThis script adds the 'check all' function to a form. Short and easy to use.

Full version: jsB@nk » Form » Checkbox » Check All Toggle Switch
URL: https://www.javascriptbank.com/check-all-toggle-switch.html



JavaScript
<script type="text/javascript">// Created by: Hillel Aftel :: equazcion (at) gmail.comfunction checkAll(checkname, exby) {  for (i = 0; i < checkname.length; i++)  checkname[i].checked = exby.checked? true:false}// --></script><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->


HTML
<form name="mylist" style="text-align: left; width: 50%;">  <input type="checkbox" name="checkGroup" value ="first">First<br>  <input type="checkbox" name="checkGroup" value ="second">Second<br>  <input type="checkbox" name="checkGroup" value ="third">Third<br>  <input type="checkbox" name="checkGroup" value ="fourth">Fourth<br>  <input type="checkbox" name="all" onClick="checkAll(document.mylist.checkGroup,this)">Check/Uncheck All<br></form><!--    This script downloaded from www.JavaScriptBank.com    Come to view and download over 2000+ free javascript at www.JavaScriptBank.com-->