check all the checkboxes by clicking on the "ALL" checkbox using jquery
<pre><code>&lt;body&gt;                                           
&lt;input type="checkbox" id="chkMain" /&gt;
&lt;input type="checkbox" id="chkMain1" /&gt;
&lt;input type="checkbox" id="chkMain2" /&gt;

&lt;br&gt;
&lt;P&gt;&lt;input class="child" type="checkbox" id="chk1" disabled="true" /&gt;
&lt;input class="child" type="checkbox" id="chk" disabled="true" /&gt;
&lt;input class="child" type="checkbox" id="chk" disabled="true" /&gt;
&lt;input class="child" type="checkbox" id="chk" disabled="true" /&gt;
&lt;input class="child" type="checkbox" id="chk" disabled="true" /&gt;
&lt;input class="child" type="checkbox" id="chk" disabled="true" /&gt;
&lt;input class="child" type="checkbox" id="chk_all" disabled="true" /&gt;ALL&lt;/p&gt;&lt;/br&gt;


$(function(){           
    $("input[id^=chkMain]").click(function(){               
        var otherCks = $("input[id^=chkMain]").not(this);
        if( !$(this).is( ":checked" )) {                        
            $(".child").attr("disabled" , true );                                     
            otherCks.removeAttr ( "disabled" );
        }                   
        else {                        
            $(".child").removeAttr ( "disabled" );                  
            otherCks.attr("disabled" , true)
        }          
    });      
 });
</code></pre>
