select 下拉列表获取选中的文本

<select id="sel" name="sel">   
	<option value="1">苹果</option>   
	<option value="2">香蕉</option>   
	<option value="3">李子</option>   
	<option value="4">西瓜</option>   
</select>


 

function getSelectText(){   
  var sel = document.getElementById('sel');   
  var index = sel.selectedIndex;   
  var text = sel.options[index].text;   
} 


 

你可能感兴趣的:(select 下拉列表获取选中的文本)