Javascript - Check All/Uncheck All checkbox function


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. function check() {
  2. var checks = document.getElementById('checkboxes').getElementsByTagName('input');
  3. var status = (document.getElementById('checkall').checked == 1) ? true : false;
  4. for(var x = 0; x < checks.length; x++) {
  5. checks[x].checked = status;
  6. }
  7. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.