Exclusive Checkboxs

Make independent check box's act like a list

by GregS

HTML

<p>
    Only one check box allowed, except red which is independant
</p>
<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;  
}

.noExcept{
    background-color:red;
}

JavaScript

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