title: How to make checkbox readonly
body: <p>I have a form with with two fields one is radio button and second one is checkbox. I want to make checkbox unchecked(If checked) and readonly when radio button value is No. My code is working for unchecked functionality but readonly does not work.Please help me</p>
  
  <p>This is my code:</p>
  
  <p>Html : </p>
  
  <pre><code>&lt;input type="radio" name="data[User][email_status]" id="" value="yes"&gt;Yes&amp;nbsp;&amp;nbsp;
  &lt;input type="radio" name="data[User][email_status]" id="" value="no" checked="checked"&gt;No 
  &lt;input type="checkbox" name="data[User][no_alerts]" id="" value="yes"&gt;
  </code></pre>
  
  <p>Jquery code : </p>
  
  <pre><code>$(document).ready(function() {
      $('input[name="data[User][email_status]"]').change (function(){
          //console.log($(this).val());
          if ($(this).val() == 'no')  {
              $('input[name="data[User][no_alerts]"]').attr({
                  'checked' : false,
              });
          }
      });  
  });
  </code></pre>
  
  <p>Thanks</p>