Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

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:






Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

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.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}