Controlling Checkboxes with JavaScript
By Will Bontrager2005-06-29
Checking or Unchecking a Group of Checkboxes
The demonstration has checkboxes representing three colors. It also has two buttons, "Check All" and "Un-check All."
The checkboxes can be checked and unchecked individually. The two buttons cause all to be checked and all to be unchecked, respectively.
The JavaScript is two functions, CheckAll() and UnCheckAll().
When the "Check All" button is clicked, function CheckAll() checks all checkboxes. And when the "Un-check All" button is clicked, function UnCheckAll() unchecks all checkboxes.
Tutorial Pages:
» Controlling Checkboxes with JavaScript
» Limiting the Number of Checkboxes
» Totaling the Value of Checked Checkboxes
» Checking or Unchecking a Group of Checkboxes
» "All" and "None" Checkboxes
Copyright 2004 Bontrager Connection, LLC
