JSFiddle - React, Tailwind, and code Playground

by GregS

HTML

<div>
    <input type="checkbox" class="except" />
</div>
<div class="noExcept">
    <input type="checkbox" class="noExcept" />
</div>
<div>
    <input type="checkbox" class="except" />
</div>
<div>
    <input type="checkbox" class="except" />
    <input type="checkbox" class="except" />
</div>

<div>
    <input type="checkbox" class="except" />
    <input type="checkbox" class="except" />
    <input type="checkbox" class="except" />
</div>

CSS

div {
    border: 1px solid black;
    margin-bottom: 1px;   
}

.noExcept{
    background-color:red;
}

JavaScript

$('.except').click(function() {
    $('.except').not(this).removeAttr('checked');
});