獲取多選框的值
var packageCodeList=new Array(); $('#server_id:checked').each(function(){ packageCodeList.push($(this).val());//向數組中添加元素 }); console.log(packageCodeList)
獲取下拉多選框 select multiple
var packageCodeList=new Array(); $("#businessRootEnvSelect option:selected").each(function(){ packageCodeList.push($(this).val());//向數組中添加元素 });