View
<td id="divStudentlist6" style="height: 100px; overflow: auto; border: solid; width: 150px;">
<input type="checkbox" id="chkAllItems" />All @foreach (var items in ViewData["Items"] as List
<SelectListItem>) {
<table width="100%">
<tr>
<td width="20px">
<input type="checkbox" value="@items.Value" class="chkclass" name="chkitems" />
</td>
<td width="100px">
@items.Text
</td>
</tr>
</table>
}
</td>jQuery
<script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>
<script>
$(document).ready(function() {
$('input[name="chkitems"]').click(function() {
$('#chkAllItems').removeAttr("checked");
});
$("#chkAllItems").click(function() {
$('input[name="chkitems"]').not(this).prop('checked', this.checked);
});
});
</script>