How can I pre-toggle a button in Bootstrap's btn-group?

后端 未结 4 1376
闹比i
闹比i 2020-12-23 19:08

How can I deploy the Radio Button group and make one of the buttons pre-toggled?

I have a radio-buttons group with days of the weeks values. This one:



        
4条回答
  •  没有蜡笔的小新
    2020-12-23 19:21

    I encountered the same problem but wanted a simpler solution. I've noticed that appending "active" to class doesn't solve the problem, as it is removed somehow (I haven't researched why it does this).

    The solution is appending "active active" to class. This way, only one is removed and the other bypasses the magic that's happening behind. It's a really dirty solution, but it solves the problem. Hope it helps!

提交回复
热议问题