On click of checkbox enable and disable checkbox
<p>hi
i want to enable the the checkboxes again if user has uncheck the checkboxes which was checked. however in my case case the id and name of the element should to be same. checkboxes are getting disabled on the basis of their values and in the same way i want to enable them back...</p>

<pre><code>  &lt;input type="checkbox" value="1"  id="preferenceid" name="preferenceid"&gt;
  &lt;span&gt;MBA&lt;/span&gt;          
  &lt;input type="checkbox" value="2"  id="preferenceid" name="preferenceid"&gt;
  &lt;span&gt;Integrated MBA&lt;/span&gt;           
  &lt;input type="checkbox" value="3"  id="preferenceid" name="preferenceid"&gt;
  &lt;span&gt;MBA/PhD&lt;/span&gt;          
  &lt;input type="checkbox" value="4"  id="preferenceid" name="preferenceid"&gt;
  &lt;span&gt;Diploma&lt;/span&gt;          
  &lt;input type="checkbox" value="5"  id="preferenceid" name="preferenceid"&gt;
  &lt;span&gt;BA(Mass Communication)&lt;/span&gt;           
  &lt;input type="checkbox" value="6"  id="preferenceid" name="preferenceid"&gt;
  &lt;span&gt;BBA&lt;/span&gt;




&lt;script type='text/javascript'&gt;
    $('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').click(function () {
                $('#preferenceid[value="5"],#preferenceid[value="6"]').attr("disabled",true);
            });


        $('#preferenceid[value="5"],#preferenceid[value="6"]').click(function () {
            $('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').attr("disabled",true);

        });


           if($('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').attr('checked')) {
            $('#preferenceid[value="5"],#preferenceid[value="6"]').attr("disabled",true);
        }

        if($('#preferenceid[value="5"],#preferenceid[value="6"]').attr('checked')) {
            $('#preferenceid[value="1"],#preferenceid[value="2"],#preferenceid[value="3"],#preferenceid[value="4"]').attr("disabled",true);

        }
&lt;/script&gt;
</code></pre>
