<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<script>
$(document).ready(function () {
$('.compbox :checkbox').not(".hidebox").click(function () {
var exclude = "";
$('.compbox :checkbox').not($(this).add(exclude)).removeAttr('checked');
});
});
</script>
<style>
.hidebox {display:none;}
.compbox {display:inline-block;}
</style>
<div class="compbox">
<input type="checkbox" class="hidebox" />
<input type="checkbox" class="compbox" /> AAA
<input type="checkbox" class="compbox" /> BBB
<input type="checkbox" class="compbox" /> CCC
<input type="checkbox" class="compbox" /> DDD
<input type="checkbox" class="compbox" /> EEE
<input type="checkbox" class="compbox" /> FFF
</div>
Ideally I would like this to not be reliant upon the first checkbox and work without the need for an extra hidden one.Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.
”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.