I have check box and when "uncheck" checkbox is checked, all check box should be unchecked and "uncheck" checkbox should be checked.
This is what I tried so far
<input type="checkbox" name="" id="c1" class="checkbox nonCheck">
<label for="c1"><span class="icon"></span>Uncheck</label>
<input type="checkbox" name="" id="c2" class="checkbox">
<label for="c2"><span class="icon"></span>value 1</label>
<input type="checkbox" name="" id="c3" class="checkbox">
<label for="c3"><span class="icon"></span>value 2</label>
$(function(){
$('.nonCheck').click(function(){
$('input:checked').prop('checked',false).not('.nonCheck');
});
})
But my code is not working. How do I change the code to fix it ? please help.