checkbox:获取所有已选中的值

  /**获取选中的checkbox值*/
  function getChecked(){
      var ids = "";
      $("input:checkbox[name='id']:checked").each(function(i){
             if(0==i){
                 ids = $(this).val();
        }else{
             ids += (","+$(this).val());
        }
    });    
    return ids;
  };     

 

posted @ 2016-04-23 15:04  peak-c  阅读(3190)  评论(0编辑  收藏  举报