jquery 实现复选框单选

$(function() {
 $(':checkbox[name=复选框name值]').each(function() {
  $(this).click(function() {
   if ($(this).attr('checked')) {
    $(':checkbox[name=复选框name值]').removeAttr('checked');
    $(this).attr('checked', 'checked');
   }
  });
 });
});

 

posted @ 2013-10-08 14:08  tao5310  阅读(3680)  评论(0编辑  收藏  举报