본문 바로가기
Programming/JavaScript/jQuery

[jquery] checkbox 하나만 체크되게 하기

by 막이 2014. 9. 4.
$(".check_class").click(function() {
  $(".check_class").attr("checked", false); //uncheck all checkboxes
  $(this).attr("checked", true);  //check the clicked one
});


$(function() { 
  $('input[type="checkbox"]').bind('click',function() {
    $('input[type="checkbox"]').not(this).prop("checked", false);
  });