I am using Boostrap 3.3.7 and are trying to use Buttons as 'Radio Button'.
This is the HTML:
<div id="selector" class="btn-group" data-toggle="buttons-radio">
<button name="resolution" class="btn btn-default btn-sm">
720
</button>
<button name="resolution" class="btn btn-default btn-sm">
480
</button>
<button name="resolution" class="btn btn-default btn-sm">
360
</button>
</div>
When I select one button, then select another one, the first does not get deselected. I tried to deselect it with JQuery but it did not work:
$('.btn-group > .btn').removeClass('active')
$('.btn-group > .btn').eq(0).addClass('active')
How can I make sure I keep one selected only? My objective is to have one button selected so I could use it. Something like this:
$("#submitButton").click(function () {
alert($('.btn-group > .btn.active').text());
});