Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

when i click on one checkbox check all checkboxes

function setAllCheckboxes(divId, sourceCheckbox) {
    divElement = document.getElementById(divId);
    inputElements = divElement.getElementsByTagName('input');
    for (i = 0; i < inputElements.length; i++) {
        if (inputElements[i].type != 'checkbox')
            continue;
        inputElements[i].checked = sourceCheckbox.checked;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #click #checkbox #check #checkboxes
ADD COMMENT
Topic
Name
7+7 =