具有相同 id 的引导多重复选框不可点击

问题描述 投票:0回答:1
html bootstrap-4
1个回答
0
投票

按如下方式修改 HTML:

<div class="form-group">
  <div class="col-sm-3">
    <div class="checkbox clip-check check-primary">
      <input type="checkbox" value="machine" name="type[]" id="machine">
      <label for="machine">
        Mesin
      </label>
    </div>
  </div>
  <div class="col-sm-3">
    <div class="checkbox clip-check check-primary">
      <input type="checkbox" value="utility" name="type[]" id="utility">
      <label for="utility">
        Utility
      </label>
    </div>
  </div>
  <div class="col-sm-3">
    <div class="checkbox clip-check check-primary">
      <input type="checkbox" value="others" name="type[]" id="others">
      <label for="others">
        Others
      </label>
    </div>
  </div>
</div>

保持标签的

for
属性中存在的相同 ID 值

© www.soinside.com 2019 - 2024. All rights reserved.