1function toggle(source) {
2 var checkboxes = document.querySelectorAll('input[type="checkbox"]');
3 for (var i = 0; i < checkboxes.length; i++) {
4 if (checkboxes[i] != source)
5 checkboxes[i].checked = source.checked;
6 }
7}
1 $( '#container .toggle-button' ).click( function () {
2 $( '#container input[type="checkbox"]' ).prop('checked', this.checked)
3 })
4