title: Bootstrap checkbox buttons not changing state
body: <p>I used to have radio buttons, but I changed the script to use bootstrap checkboxes. But it is not changing the state when using bootstrap switches.</p>
  
  <p>This is snippet of my code:</p>
  
  <pre><code>&lt;div class="form-group"&gt;
      &lt;div class="radio-list"&gt;
          &lt;label class="radio-inline"&gt;
              &lt;input type="radio" name="upd_active" class="updactive" id="upd_yes" value="1" checked&gt; Yes &lt;/label&gt;
              &lt;label class="radio-inline"&gt;
              &lt;input type="radio" name="upd_active" class="updactive" id="upd_no" value="0"&gt; No &lt;/label&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;script&gt;
      function action(){}
          var parentflag = $('#upd_yes').parents('.form-group');
          parentflag.find('span').removeClass('checked');
          if(is_active == "1"){
              $("#upd_no").attr('checked', false);
              $("#upd_yes").attr('checked', true);
              $('#upd_yes').parent().addClass('checked');
          }
          else{
              $("#upd_yes").attr('checked', false);
              $("#upd_no").attr('checked', true);
              $('#upd_no').parent().addClass('checked');
          }
      }
      &lt;/script&gt;
  
  &lt;div class="form-group"&gt;
  &lt;label class="col-md-3 control-label"&gt;IsActive&lt;span class="text-danger"&gt;*&lt;/span&gt;&lt;/label&gt;
       &lt;div class="col-md-8"&gt;
           &lt;input type="checkbox" name="upd_active" class="make-switch updactive" id="upd_yes" value="1" checked&gt;
       &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
      function action(){
          var parentflag = $('#upd_yes').parents('.form-group');
          parentflag.find('span').removeClass('checked');
          if(is_active == "1"){
              $("#upd_yes").attr("checked",true);
              $('#upd_yes').parent().addClass('checked');
          }
          else{
              $("#upd_yes").attr("checked",false);
              $('#upd_yes').parent().removeClass('checked');
          }
      }
  &lt;/script&gt;
  </code></pre>
  
  <p>How can I fix this?</p>