我有HTML项目,4例如:jQuery。如何取消除此之外的所有复选框(这是选中)
<div>
<div><input type="checkbox" class="foo"> Checkbox</div>
<div><input type="checkbox" class="foo"> Checkbox</div>
<div><input type="checkbox" class="foo"> Checkbox</div>
<div><input type="checkbox" class="foo"> Checkbox</div>
<div><input type="checkbox" class="foo"> Checkbox</div>
<div><input type="checkbox" class="foo"> Checkbox</div>
</div>
而现在,我想未来:如果我点击任何复选框 - 复选框应检查及其他复选框应该取消选中。我该怎么做?
你想叫一个单选按钮...... – RRikesh
@弗朗索瓦·瓦尔,没有什么问题!我不知道这件事。 – Andrew