Check All | JavaScriptSource

Check All

Nannette Thacker Apr 28, 2000


Dynamically checks and unchecks all the checkboxes in a form when a button is clicked. Much easier than manually hard-coding the checkbox names.

Make a selection


Source Code

Paste this source code into the designated areas.

External file

Paste this code into an external JavaScript file named: checkAll.js


Paste this code into the HEAD section of your HTML document.


Paste this code into the BODY section of your HTML document

Leave a Response


Thank for code, is more more practic.

Muy bueno Jan 23, 2015

Your question is beyond the scope of these comments. You will need to post it over on [a href=""]the JavaScript forum[/a]. Thanks!

Lee Jan 16, 2009

Robert,[br /][br /]There should be no reason why the method of processing the form would affect the usage of this script.

Lee Dec 2, 2008

Hi[br /][br /]I read your article but it like to know it is possibel to use this script for asp:checkboxlist.[br /][br /]pls send me details[br /][br /]Regards[br /]karan panchal

karan panchal Nov 21, 2008

The action attribut is empty. However, usually one will have a action with a form. But then those check/uncheck all buttons would behave falsely.[br /][br /]So what would be a better solution in this case?

robert Nov 19, 2008