JQUERY多选框,单选框,检查选中的值

  var str="";
           $(":checkbox:checked").each(function(){ 
               if($(this).attr("checked")){
                   str += $(this).val()+","
               }
           })

 

 

 var cval = ($(":checkbox:checked").val());

 

var beixuan = document.getElementsByName("goodsExchangeableCon[]").length; 
    var k = 0;
    for(var i = 0; i < beixuan; i++){
      if(document.getElementsByName("goodsExchangeableCon[]")[i].checked == true){
          k = k+1;
      }
    }

 

posted @ 2013-07-02 17:59  jshaibozhong  阅读(279)  评论(0编辑  收藏  举报