Advertisement
afsarwebdev

select all checkbox

Sep 12th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. //HTML
  2. <input type="checkbox" id="ckbCheckAll" /> Select all
  3. <div id="checkBoxes">
  4. <input type="checkbox" class="checkBoxClass" id="Checkbox1" />
  5. <br />
  6. <input type="checkbox" class="checkBoxClass" id="Checkbox2" />
  7. <br />
  8. <input type="checkbox" class="checkBoxClass" id="Checkbox3" />
  9. <br />
  10. </div>
  11. //JS
  12. $(document).ready(function () {
  13. $("#ckbCheckAll").click(function () {
  14. $(".checkBoxClass").prop('checked', $(this).prop('checked'));
  15. });
  16. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement