title: Change Toggle Switch status dynamically
body: <p>I am trying to figure out how to set toggle switch button base on a value. I am using bootstrap for the button. Anyone please tell me what is wrong? </p>
  
  <p>*user.isActive only have two value either true or false.</p>
  
  <pre><code>&lt;td&gt;&lt;input id="activeSwitch" data-toggle="toggle" data-on="Active" data-off="InActive" data-onstyle="danger" data-width="90" data-height="30" style="font-size:38px" type="checkbox"&gt;
  &lt;input type="hidden" id="activeStatus" value='${user.isActive}'/&gt;&lt;/td&gt;
  
  &lt;script&gt;
   $(document).ready(function() {
  
                  if($('#activeStatus').val() == 'true'){
                        $("#activeSwitch").attr("checked", "checked");
                  }
  
                  else if($('#activeStatus').val() == 'false'){
                       ...
                  }
              });  
  &lt;/script&gt;
  </code></pre>