Skip to content

Instantly share code, notes, and snippets.

@DmitrySandalov
Created January 18, 2013 18:31
Show Gist options
  • Save DmitrySandalov/4566998 to your computer and use it in GitHub Desktop.
Save DmitrySandalov/4566998 to your computer and use it in GitHub Desktop.
JavaScript Check All Checkboxes
function check_all_in_document(doc)
{
var c = new Array();
c = doc.getElementsByTagName('input');
for (var i = 0; i < c.length; i++)
{
if (c[i].type == 'checkbox')
{
c[i].checked = true;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment