【发布时间】:2020-10-28 13:21:18
【问题描述】:
【问题讨论】:
-
您在 Google(或任何其他搜索引擎)上搜索过什么?请编辑您的问题以包含该内容。
-
请在描述中给出详细信息。不是问题的标题
-
我找不到设计代码,但是我找到了“一个复选框同时选中或取消选中许多其他复选框”的解决方案,我已经知道了。
标签: css checkbox checkboxlist
【问题讨论】:
标签: css checkbox checkboxlist
好的...所以您只想要 CSS...请检查以下代码并根据您的大小和需要进行调整
input[type='checkbox'] {
width: 90px;
height: 90px;
background: white;
border-radius: 5px;
border: 2px solid #555;
}
<input style="float:left;" type="checkbox" />
<label class="form-check-label"><br>First line <br> Second line <br> third line</label>
【讨论】:
我不确定这是否可能。但是,您可以使用一个复选框同时选中或取消选中许多其他复选框。你可以使用下面的代码来做到这一点
$('#selectAllBoxes').click(function(event) {
if (this.checked) {
$('.checkBoxes').each(function() {
this.checked = true;
});
} else {
$('.checkBoxes').each(function() {
this.checked = false;
});
}
});
<input class="checkBoxes" type="checkbox" name="selectAllBoxes" id="selectAllBoxes">
【讨论】: