jquery - Bootstrap - data-toggle attribute when multiple buttons exist -
i have several buttons. when user clicks button want give him impression button clicked .
this 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 works when have single button:
<button class="btn" data-toggle="button">today</button>
if user clicks on tomorrow, data-toggle attribute still remains today button. instead, want disable data-toggle attribute when button clicked.
you can use bootstraps radio button functionality achieve 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>
Comments
Post a Comment