/ Published in: JavaScript
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
function check() { var checks = document.getElementById('checkboxes').getElementsByTagName('input'); var status = (document.getElementById('checkall').checked == 1) ? true : false; for(var x = 0; x < checks.length; x++) { checks[x].checked = status; } }