jquery click event for checking one main checkbox and disable all other
<p>i m trying to make a function in jquery to disable a group of checkboxes on click one main checkbox</p>

<p><strong>function is</strong> </p>

<pre><code>function DisableCheckboxes(id)
{

    if($(this).is(':checked'))
    {
         $("input[name="+id+"]").each(function(){
            $(this).attr({
            'checked':false,
            'disabled':true});        
        });
    }
    else
    {
        $("input[name="+id+"]").each(function(){
            $(this).attr('disabled',false);        
        });
    }

}
</code></pre>

<p><strong>and call it on click event as -</strong></p>

<pre><code>$(document).ready(function() {

$("#chkNotMatter").click(DisableCheckboxes('chklStatus'));

});
</code></pre>

<p><strong>problem is</strong>
the click event donot gets applied and the main checkbox gets checked</p>
