$(function(){ var uniquecheck = $('.singlecheck').find('input[type=checkbox]'); uniquecheck.click(function() { var group = $(this).attr('data-scgroup'); uniquecheck.filter(function() { return $(this).attr('data-scgroup') == group; }).not(this).removeAttr('checked'); }); });
<p>List.1</p> <ul class="singlecheck"> <li><label class="g1" for="check1"><input type="checkbox" name="check1" id="check1" data-scgroup="group1">list.1</label></li> <li><label class="g1" for="check2"><input type="checkbox" name="check2" id="check2" data-scgroup="group1">list.2</label></li> <li><label class="g1" for="check3"><input type="checkbox" name="check3" id="check3" data-scgroup="group1">list.3</label></li> <li><label class="g1" for="check4"><input type="checkbox" name="check4" id="check4" data-scgroup="group1">list.4</label></li> </ul> <p>List.2</p> <ul class="singlecheck"> <li><label class="g1" for="check5"><input type="checkbox" name="check5" id="check5" data-scgroup="group1">list.5</label></li> <li><label class="g1" for="check6"><input type="checkbox" name="check6" id="check6" data-scgroup="group1">list.6</label></li> <li><label class="g2" for="check_A"><input type="checkbox" name="check_A" id="check_A" data-scgroup="group2">list.A-1</label></li> <li><label class="g2" for="check_B"><input type="checkbox" name="check_B" id="check_B" data-scgroup="group2">list.A-2</label></li> <li><label class="g3" for="check_C"><input type="checkbox" name="check_C" id="check_C" data-scgroup="group3">list.B-1</label></li> <li><label class="g3" for="check_D"><input type="checkbox" name="check_D" id="check_D" data-scgroup="group3">list.B-2</label></li> </ul>