exhtml
1/4/2019 - 11:00 AM

Bootstrap button group radio buttons

`
<div class="btn-group btn-group-xs" data-toggle="buttons">
    <label class="btn btn-default active">
        <input type="radio" name="filterFlexis" value="" autocomplete="off" checked> ?
    </label>
    <label class="btn btn-default">
        <input type="radio" id="fru" name="filterFlexis" value="true" autocomplete="off"> S
    </label>
    <label class="btn btn-default">
        <input type="radio" name="filterFlexis" value="false" autocomplete="off"> N
    </label>
</div>
`

var $radioIsFlexi =  $('input:radio[name="filterFlexis"]');

//marcar uno de los buttons
$radioIsFlexi.removeAttr('checked');
var $selectedButton = $('input:radio[name="filterFlexis"][value="' + valorQueQuiera + '"]');
$selectedButton.prop('checked', true).trigger('change');
$selectedButton.parent().addClass('active').siblings().removeClass('active');

//detectar cambios
$radioIsFlexi.on('change', function(){
    var val = $(this).val();
    console.log(val);
});