0

Header checkbox as

<th>
    <input id="chkAll" type="checkbox" />
</th>

Child checkboxes code

<td>
    <input id="employeeIdsToDelete" type="checkbox" name="employeeIdsToDelete" value="@Model.Id" />
</td>

Jquery code as:

<script src="~/Scripts/jquery-1.10.2.min.js"></script>

<script type="text/javascript">
    $(function () {
        $("#chkAll").click(function () {
                            $("input:checkbox[name=employeeIdsToDelete]").attr("checked",this.checked);
        });
    });
</script>

when first click header checkbox it is working but when again click on header checkkbox is not working. when page refreshed it working but one time only

phts
  • 3,889
  • 1
  • 19
  • 31
Dnyneshwar
  • 728
  • 8
  • 10

0 Answers0