Bootstrap - data-toggle attribute when multiple buttons exist

css, jquery, twitter-bootstrap

Solution

You can use the bootstraps radio button functionality to achieve that effect. Try this:

<div data-toggle="buttons-radio">
    <button class="btn btn-danger">Today</button>
    <button class="btn btn-danger">Tomorrow</button>
    <button class="btn btn-danger">DayAfterTomorrow</button>
</div>

Demo: http://jsfiddle.net/u7Lg8/

Problem

I have several buttons. When a user clicks any button I want to give him the impression that the button is clicked . This is the code: ``` <table> <thead> <tr> <th><button class="btn btn-danger" >Today</button></th> <th><button class="btn btn-danger" >Tomorrow</button></th> <th><button class="btn btn-danger" >DayAfterTomorrow</button></th> </tr> </thead> </table> ``` And this works when I have a single button: ``` <button class="btn" data-toggle="button">Today</button> ``` If the user clicks on tomorrow, the data-toggle attribute still remains for the today button. Instead, I want to disable the data-toggle attribute when another button is clicked.

Original source