I am implementing an HTML form with some checkbox input elements, and I want to have a Select All or DeSelect All button. However, I do not want to rely on the name
function findCheckBoxes(el, check) { for(var i=0;el.childNodes[i];i++) { var child = el.childNodes[i]; if (child.type=="checkbox") { child.checked = check; } if (child.childNodes.length > 0) this.findCheckBoxes(child, check); } }