javascript to disable /enable a checkbox
<p>I have the below syntax which unchecks a checkbox.</p>

<pre><code>$('#h12_1').attr('checked','checked');
</code></pre>

<p><code>h12_1</code> is the name of my checkbox.</p>

<p>How do I disable the checkbox so it cannot be checked? similarly how do I enable the checkbox again?</p>

<p>Something like this:</p>

<pre><code> $.post('get_as_12', {data:selectedObj.value},function(result) {
 alert(result[0]) ;

      if(result[0] &gt; 0) {
          $('#h12_1').attr('checked','enabled');
          $('#h12_1').attr('checked','checked');
       } else {
          $('#h15_1').attr('disabled');
          $('#h15_1').removeAttr('checked');
      }
 }); 
</code></pre>
