JavaScript - Check and un check all option using jquery

Asked By abinav shankar on 07-May-13 02:02 AM

I have a html table with a check box in each row and a check all option as well I want to know how do check and uncheck all using jquery
Ramendra Kumar replied to abinav shankar on 07-May-13 02:21 AM
Try it using Jquery, write a class name in check box

<asp:CheckBox ID="chkDel" runat="server" class="cDel"  />

now on master checkbox try like this,if this will checked all will be checked else vice versa.
<input type="checkbox" onclick="$('.cDel :checkbox').attr('checked',this.checked);" />

or you may also use each functiuon of jquery