select/deselect-all control


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



Copy this code and paste it in your HTML
  1. <script type="text/javascript">
  2. <!--
  3. function checkAll(wotForm,wotState) {
  4. for (a=0; a<wotForm.elements.length; a++) {
  5. if (wotForm.elements[a].id.indexOf("delete_") == 0) {
  6. wotForm.elements[a].checked = wotState ;
  7. }
  8. }
  9. }
  10. // -->
  11. </script>
  12.  
  13. <input type="checkbox" onClick="checkAll(this.form,this.checked);" />

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.