Select or Unselect all Checkbox

You can use this free javascript code to Select / Unselect all the checkboxes by selecting a single check box.


  • There can be any number of checkboxes for selection.
  • All the checkboxes can be selected just by selecting one check box in common.
  • Also the same can be used to check and uncheck all in a single click.


Select or Unselect all Checkboxes:

Check or Uncheck the checkbox placed below.


<!--Script by>
<!-- Free javascripts @ -->
<script type="text/javascript">
function checkedAll (frm1) {var aa= document.getElementById('frm1'); if (checked == false)
checked = true
checked = false
}for (var i =0; i < aa.elements.length; i++){ aa.elements[i].checked = checked;}
<!-- Script by -->

  • Release Date - 20.06.2007
  • Get free version without ©copyright link for just $10/-
  • For customization of this script or any script development, mail to


  • Now just copy the above free JavaScript code in your web page inside the head tag.
  • Create any number of check boxes and place in a form and name that form as "frm1"
  • <form id ="frm1">
    <input type="checkbox" name="chk1">
    <input type="checkbox" name="chk2">
  • Create a common checkbox in the form and name its as "checkall". Now Call the function checkedAll(frm1) by using onclick event.
  • <input type='checkbox' name='checkall' onclick='checkedAll(frm1);'>


Related Scripts

Free Javascript Scripts

Ask Questions

Ask Question