首页 > 代码库 > JS获取select框的值

JS获取select框的值

         
         var obj = document.getElementsByName(‘vipActs‘);
         var val = "";
         for (var i = 0; i < obj.length; i++) {
             if(obj[i].checked==true){
                val = val + obj[i].value+",";
             }
        }

//vipActs为复选框的name值

 

JS获取select框的值