Crabar
Crabar

Reputation: 1857

Reset bootstrap button state

I have a form with a few toggle buttons:

  <div id="options-group" class="row">
    <button id="burning-option-button" class="btn option-toggle-button" data-toggle="button" aria-pressed="false" autocomplete="off"></button>
    <button id="flacky-cocktail-button" class="btn option-toggle-button" data-toggle="button" aria-pressed="false" autocomplete="off"></button>
    <button id="ice-cocktail-button" class="btn option-toggle-button" data-toggle="button" aria-pressed="false" autocomplete="off"></button>
    <button id="official-cocktail-button" class="btn option-toggle-button" data-toggle="button" aria-pressed="false" autocomplete="off"></button>
    <button id="checked-cocktail-button" class="btn option-toggle-button" data-toggle="button" aria-pressed="false" autocomplete="off"></button>
  </div>

Now I want to add button with possibility to reset states of that buttons. What the best way to "unselect" toggled buttons using jquery/js?

I'm using Bootstrap3.

Upvotes: 0

Views: 1881

Answers (1)

madalinivascu
madalinivascu

Reputation: 32354

Try:

$('button.active').removeClass('active');

https://jsfiddle.net/fpdwef37/

Upvotes: 1

Related Questions