js如何获取很多个select里面的optin的值 并且把值求和,传递到后台,我现在只会1个一个的获取求指点

检查 计算 人:分 房屋:分
提交 返回

function homsave() { var name = $("#text1").val(), idcode = $("#text2").val(); var remarks = $("#text34").val(), bank = $("#text35").val(); var mtion = $("#text36").val(); $.ajax({ type: "POST", //提交的方法 url:"/business/save", //提交的地址 data:$('#homesave').serialize(),// 序列化表单值 async: false, error: function(request) { //失败的话 alert("Connection error"); }, success: function(data) { //成功 alert(data); //就将返回的数据显示出来 window.location.href="跳转页面" } }); // var name = $("#text1").val(), idcode = $("#text2").val(); // var remarks = $("#text34").val(), bank = $("#text35").val(); // var mtion = $("#text36").val(); // if (remarks == null || remarks == "") { // alert("备注不能为空"); // return; // } // if (bank == null || bank == "") { // $("#text35").val("--"); // } // if (mtion == null || remarks == "") { // $("#text36").val("--"); // } alert(name+idcode) } function jc() { var remarks = $("#text34").val(), bank = $("#text35").val(); var mtion = $("#text36").val(); if (remarks == null || remarks == "") { $("#text34").val("--"); } if (bank == null || bank == "") { $("#text35").val("--"); } if (mtion == null || remarks == "") { $("#text36").val("--"); } } function js() { var text3 = $("#text3").find("option:selected").val(); var text4 = $("#text4").find("option:selected").val(); var text5 = $("#text5").find("option:selected").val(); var text6 = $("#text6").find("option:selected").val(); var text7 = $("#text7").find("option:selected").val(); var text8 = $("#text8").find("option:selected").val(); var text9 = $("#text9").find("option:selected").val(); var text10 = $("#text10").find("option:selected").val(); // var text11 = $("#text11").find("option:selected").val(); var text12 = $("#text12").find("option:selected").val(); var text13 = $("#text13").find("option:selected").val(); var text14 = $("#text14").find("option:selected").val(); var text26 = $("#text26").find("option:selected").val(); var text27 = $("#text27").find("option:selected").val(); var text28 = $("#text28").find("option:selected").val(); var text29 = $("#text29").find("option:selected").val(); var text30 = $("#text30").find("option:selected").val(); var text31 = $("#text31").find("option:selected").val(); var text32 = $("#text32").find("option:selected").val(); var text33 = $("#text33").find("option:selected").val(); var menfen = parseInt(text3)+parseInt(text4)+parseInt(text5)+parseInt(text6) +parseInt(text7)+parseInt(text8)+parseInt(text9)+parseInt(text10) +parseInt(text12)+parseInt(text13)+parseInt(text14); var homefen = parseInt(text26)+parseInt(text27)+parseInt(text28)+parseInt(text29) +parseInt(text30)+parseInt(text31)+parseInt(text32)+parseInt(text33); $("#men").val(menfen); $("#home").val(homefen) }

这代码。。。能格式化一下么?