<div class="btn-group" data-toggle="buttons">
<label class="btn btn-sm btn-primary success active">
<input type="radio" name="options" id="optionFalse" checked />false
</label>
<label class="btn btn-sm btn-primary danger">
<input type="radio" name="options" id="optionTrue" />true
</label>
</div>
$('#optionTrue').button('toggle');
質問の回答をさらに読みましたが、どれも機能しません。ボタンのトグルが機能しません。「アクティブな」クラスを追加/削除しようとしましたが、効果がありません。1.10 jQuery と 3.1 Bootstrap を使用しています。これは単純なはずです。髪を引っ張っています。