function checkForm(name) { checkForm.checked = !checkForm.checked; var nodes = document.getElementsByName(name); for (var i = 0; i < nodes.length; i++) { nodes[i].checked = checkForm.checked; } }