twitter-bootstrap – Bootstrap data-toggle =“buttons”radio
发布时间:2020-12-17 21:24:34 所属栏目:安全 来源:网络整理
导读:我看到Bootstrap单选按钮(使用data-toggle =“buttons”创建)更改事件切换标签之间的活动类,并且不会影响真实单选按钮的已检查属性.这是正常的行为还是我有错? 或者,如何以双向方式将此活动类别的标签和已检查的无线电属性相互绑定,以便它们同时更改? 示例
我看到Bootstrap单选按钮(使用data-toggle =“buttons”创建)更改事件切换标签之间的活动类,并且不会影响真实单选按钮的已检查属性.这是正常的行为还是我有错?
或者,如何以双向方式将此活动类别的标签和已检查的无线电属性相互绑定,以便它们同时更改? 示例代码: <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> 解决方法
检查此代码
<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> 问候 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |