Sae Us
Sae Us

Reputation: 277

Bootstrap Reset Button in btn-group

I'm using Bootstrap buttons which i have in a btn-group.

<div class="btn-group">
     <button type="button" class="btn  "data-toggle="button">Item1</button>
     <button type="button" class="btn  "data-toggle="button">Item2</button>
</div>

So at the moment (as i'm using data-toggle), when a button is pressed it goes into a highlighted mode. I now want a clear button, when that is tapped I would like the buttons to be reset. I've read the manual and see I have to use: $().button('reset')

However its just not working. Could someone please help with an example.

Upvotes: 3

Views: 6716

Answers (1)

Stokedout
Stokedout

Reputation: 11045

It's simple... All you need to call is:

$('.btn-group button').removeClass('active');

This is essentially what the code does when you toggle it.

Upvotes: 9

Related Questions