php - how to select/deselect all checkboxes generated in loop when parent checkbox is checked -
<script> $(function(){ $('.parent').on('click',function(){ $(this).find('.child[]').attr('checked',this.checked); }); }); </script> <table> <thead> <tr> <th>s no.</th> <th><input type="checkbox" name="select1" id="select1" class="parent" /></th> <th>title</th> <th>end date</th> <th>action</th> <th>deal type</th> <th>status</th> </tr> </thead> <tbody> <tr> <?php $sql="select * table_name id='$id'"; $result=mysql_query($sql); $sn=1; while($show=mysql_fetch_array($result)) { $student=$show['student']; ?> <td><?php echo $sn; ?></td> <td><?php echo "<input type='checkb...