var arr = new Array(); //数组定义标准形式,不要写成Array arr = new Array(); var all = ""; //定义变量全部保存 $("#UserBorough option").each(function () { var txt = $(this).text(); //获取单个text var val = $(this).val(); //获取单个value var node = "<" + txt + ">" + val + "</" + txt + ">"; arr.push(node); all += node; }); alert(all); alert(arr);