Last post May 04, 2019 10:47 AM by mgebhard
Member
75 Points
513 Posts
May 04, 2019 12:48 AM|zhyanadil.it@gmail.com|LINK
i have this table i want by button click check all checkboxes checked
<table id="t"> <tr> <td><input type="checkbox"></td> <td><input type="checkbox"></td> <td><input type="checkbox"></td> </tr> <tr> <td><input type="checkbox"></td> <td><input type="checkbox"></td> <td><input type="checkbox"></td> </tr> <tr> <td><input type="checkbox"></td> <td><input type="checkbox"></td> <td><input type="checkbox"></td> </tr> <tr> <td><input type="checkbox"></td> <td><input type="checkbox"></td> <td><input type="checkbox"></td> </tr> <tr> <td><input type="checkbox"></td> <td><input type="checkbox"></td> <td><input type="checkbox"></td> </tr> </table>
All-Star
53631 Points
23987 Posts
May 04, 2019 10:47 AM|mgebhard|LINK
zhyanadil.it@gmail.com button click check all checkboxes checked
<script> $('#Button1').click(function (e) { e.preventDefault(); $('#t input:checkbox').each(function () { $(this).prop('checked', true); }); }); </script>
See jQuery docs for selectors, $.each(), and $.prop().
https://api.jquery.com/category/selectors/
http://api.jquery.com/jquery.each/
http://api.jquery.com/prop/
Member
75 Points
513 Posts
how to check all checkboxes inside table by button click
May 04, 2019 12:48 AM|zhyanadil.it@gmail.com|LINK
i have this table i want by button click check all checkboxes checked
All-Star
53631 Points
23987 Posts
Re: how to check all checkboxes inside table by button click
May 04, 2019 10:47 AM|mgebhard|LINK
See jQuery docs for selectors, $.each(), and $.prop().
https://api.jquery.com/category/selectors/
http://api.jquery.com/jquery.each/
http://api.jquery.com/prop/