<!DOCTYPE html> <html lang="en" xmlns="http://www.w3.org/1999/xhtml"> <head> <meta charset="utf-8" /> <title></title> </head> <body> <select id="MySelect"> <option value="1">选项A</option> <option value="2">选项B</option> </select> </body> </html>
<script type="text/javascript"> /* 普通JS脚本获取 */ var mySelect = document.getElementById("MySelect"); //找到下拉列表控件 var selectIndex = mySelect.selectedIndex; //获取选中项的索引 var text = mySelect.options[selectIndex].text; //选中项的文本 var value = obj.options[index].value; // 选中项的值 /* 通过jQuery获取 */ $("#MySelect option:selected").text();//选中的文本 $("#MySelect option:selected").val();//选中项的值 </script>