Twitter bootstrap 引导数据切换=";按钮“;无线电检查属性

Twitter bootstrap 引导数据切换=";按钮“;无线电检查属性,twitter-bootstrap,radio-button,onchange,Twitter Bootstrap,Radio Button,Onchange,我看到引导单选按钮(使用data toggle=“buttons”)change事件在标签之间切换active类,并且对实际单选按钮的选中的属性没有影响。这是正常行为还是我犯了错误 或者,如何将标签的活动类别和收音机的已检查属性以双向方式相互绑定,以便它们同时更改 示例代码: <div class="btn-group" data-toggle="buttons"> <label class="btn btn-primary active"> <inpu

我看到引导单选按钮(使用data toggle=“buttons”)change事件在标签之间切换active类,并且对实际单选按钮的选中的属性没有影响。这是正常行为还是我犯了错误

或者,如何将标签的活动类别和收音机的已检查属性以双向方式相互绑定,以便它们同时更改

示例代码:

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary active">
    <input type="radio" name="options" id="option1" autocomplete="off" checked> Radio 1 (preselected)
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option2" autocomplete="off"> Radio 2
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option3" autocomplete="off"> Radio 3
  </label>
</div>

收音机1(预选)
第二台
第三台
检查此代码

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary active">
    <input type="radio" name="options1" id="option1" autocomplete="off"> Radio 1 (preselected)
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options2" id="option2" autocomplete="off"> Radio 2
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options3" id="option3" autocomplete="off"> Radio 3
  </label>
</div>

收音机1(预选)
第二台
第三台

关于

如果要预先切换按钮,则必须手动将
.active
类和
aria pressed=“true”
添加到


此问题是否已解决?。因为我也有相同的问题。
name
属性不共享相同的名称会中断单选按钮组的切换行为。请编辑我的上一条评论:即使是从(或)复制的原始文档都有
name=“options”