下拉列表

<select id="test"  name="">   
  <option   value="1">text1</option>   
  <option   value="2">text2</option>   
</select>

js如何获取下拉列表选中的值:
1、      拿到selected对象:var obj=document.getElementById("#test");
           拿到选中的索引:  var index=obj.selectedIndex;
 拿到选中项options的value: obj.options[index].value;
 拿到选中项options的text  :obj.options[index].text;

jquery如何获取下拉列表selecte的值:
$('select option:selected').val()
$('select option:selected').text()



js、jQuery 关于下拉框 取值操作
https://www.cnblogs.com/wangbogo/archive/2012/06/26/2564096.html



原文地址:https://www.cnblogs.com/zouhong/p/9444490.html