Over a million developers have joined DZone.

Check / Uncheck All Checkboxes In A Pseudo Group

DZone's Guide to

Check / Uncheck All Checkboxes In A Pseudo Group

Free Resource
This bit of javascript will check and uncheck all checkboxes in a group of checkboxes. The checkboxes are grouped by naming all the checkboxes by the same name.

Javascript Code:

function checkUncheckAll(checkAllState, cbGroup)
	for (i = 0; i < cbGroup.length; i++)
		cbGroup[i].checked = checkAllState.checked;

HTML Code:


Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}