Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //HTML
- <input type="checkbox" id="ckbCheckAll" /> Select all
- <div id="checkBoxes">
- <input type="checkbox" class="checkBoxClass" id="Checkbox1" />
- <br />
- <input type="checkbox" class="checkBoxClass" id="Checkbox2" />
- <br />
- <input type="checkbox" class="checkBoxClass" id="Checkbox3" />
- <br />
- </div>
- //JS
- $(document).ready(function () {
- $("#ckbCheckAll").click(function () {
- $(".checkBoxClass").prop('checked', $(this).prop('checked'));
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement