title: Toggle checkbox on Twitter Bootstrap
body: <p>I made a group of checkboxes with Twitter Bootstrap. Now I would like to do a "select all" or "deselect all" button. How could I do this using a JS function?</p>
  
  <p>The Twitter Bootstrap documentation says to use $().button('toggle') but it doesn't work.</p>
  
  <p>Here is my code snippet:</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;div class="control-group"&gt;
  &lt;div class="controls"&gt;
      &lt;div class="input"&gt;
          &lt;div class="btn-group"&gt;
              &lt;label class="btn  btn-toggle" for="colors-1-toggle-0"&gt;
                  &lt;input type="checkbox" id="colors-1-toggle-0" name="colors-1[]" value="color_c" /&gt;C
              &lt;/label&gt;
              &lt;label class="btn  btn-toggle" for="colors-1-toggle-1"&gt;
                  &lt;input type="checkbox" id="colors-1-toggle-1" name="colors-1[]" value="color_m" /&gt;M
              &lt;/label&gt;
              &lt;label class="btn  btn-toggle" for="colors-1-toggle-2"&gt;
                  &lt;input type="checkbox" id="colors-1-toggle-2" name="colors-1[]" value="color_y" /&gt;Y
              &lt;/label&gt;
              &lt;label class="btn  btn-toggle" for="colors-1-toggle-3"&gt;
                  &lt;input type="checkbox" id="colors-1-toggle-3" name="colors-1[]" value="color_k" /&gt;K
              &lt;/label&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;&lt;/div&gt;
  </code></pre>