document.write('

 解析:

<select id="test" name="">
 <option value="1">text1</option>
 <option value="2">text2</option>
</select>
code:
1.JavaScript 原生的方法
• 拿到 select 对象:Var myselect=document.getElementById("test");
• 拿到选中项的索引 :var index=myselect.selectedIndex// selectedIndex 代表
的是你所选中项的 index;
• 拿到选中项 options 的 value:myselect.options[index].value;
• 拿到选中项 options 的 text:myselect.options[index].text。
2.jQuery 方法(前提是已经加载了 jQuery 库)
• var options=$("#test option:selected") // 获取选中的项;
• alert(options.val()) // 拿到选中项的值;
• alert(options.text()) // 拿到选中项的文本。
');