Check all the checkboxes in the list - Node.js HTML

Node.js examples for HTML:Checkbox

Description

Check all the checkboxes in the list

Demo Code


function checkAll(theForm) { // check all the checkboxes in the list
  for (var i=0;i<theForm.elements.length;i++) {
    var e = theForm.elements[i];
        var eName = e.name;
        if (eName != 'allbox' && 
            (e.type.indexOf("checkbox") == 0)) {
            e.checked = theForm.allbox.checked;        
        }//ww w.  j a v  a2s .c  o  m
    } 
}

Related Tutorials