Buttons JS

Buttons

<button type="button" id="loading-example-btn" data-loading-text="Loading..." class="btn btn-primary">
  Loading state
</button>

<script>
  $('#loading-example-btn').click(function () {
    var btn = $(this)
    btn.button('loading')
    $.ajax(...).always(function () {
      btn.button('reset')
    });
  });
</script>

Single toggle

<button type="button" class="btn btn-primary" data-toggle="button">Single toggle</button>

Checkbox

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary">
    <input type="checkbox"> Option 1
  </label>
  <label class="btn btn-primary">
    <input type="checkbox"> Option 2
  </label>
  <label class="btn btn-primary">
    <input type="checkbox"> Option 3
  </label>
</div>

Radio

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary">
    <input type="radio"> Option 1
  </label>
  <label class="btn btn-primary">
    <input type="radio"> Option 2
  </label>
  <label class="btn btn-primary">
    <input type="radio"> Option 3
  </label>
</div>