jquery--获取多选框的值、获取下拉多选框的值

获取多选框的值

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());//向数组中添加元素
        });

  





猜你喜欢

转载自www.cnblogs.com/lutt/p/12327274.html