小编Cai*_*lyn的帖子

使用Bootstrap 4扩展单选按钮切换

我正在尝试使用Bootstrap 4创建一个表单,在单击每个"按钮"时展开不同的元素.

它应该如何工作:按钮(收音机):是/否---如果单击"是",则它会展开包含复选框按钮的元素.

<div class="btn-group" data-toggle="buttons">
  <label class="btn btn-primary active" data-toggle="collapse" href="#collapseExample" aria-expanded="false"> 
    <input type="radio" name="options" id="option2" autocomplete="off"> Yes
  </label>
  <label class="btn btn-primary">
    <input type="radio" name="options" id="option3" autocomplete="off"> No
  </label>
</div>
<!-- Expanded Buttons -->
<div class="btn-group collapse" id="collapseExample" data-toggle="buttons">
  <label class="btn btn-primary active">
    <input type="checkbox" autocomplete="off"> Checkbox 2
  </label>
  <label class="btn btn-primary">
    <input type="checkbox" autocomplete="off"> Checkbox 3
  </label>
</div>
<!-- / Expand Buttons -->
Run Code Online (Sandbox Code Playgroud)

这是我笔的链接.

toggle bootstrap-4

5
推荐指数
2
解决办法
2338
查看次数

标签 统计

bootstrap-4 ×1

toggle ×1