Bootstrap data-toggle="toggle" checked,unchecked by jquery
<p>I'm using bootstrap checkbox with data-toggle="toggle" attribute. I want to set it checked and unchecked with jquery. I tried many ways but it didn't work. Here is my code.</p>

<pre><code>&lt;input type="checkbox" data-toggle="toggle" data-size="small" id="checkbox1"&gt;
</code></pre>

<p>for button click:</p>

<pre><code>$("#checkbox").attr('checked',true);
</code></pre>

<p><strong>But it's working when I remove <code>data-toggle="toggle"</code> attribute.</strong></p>

<p>Any help is greatly appreciated!</p>

<p>Thanks.</p>