【发布时间】:2012-08-03 10:28:01
【问题描述】:
可能重复:
How to get the selected value of dropdownlist using JavaScript?
How to get the value of a selected text in javascript
<select id="short_code">
<option value="12">First</option>
<option value="11">Second</option>
<option value="10">Third</option>
<option value="9">Fourth</option>
</select>
我需要这样做:
if(document.getElementById("short_code").options.item(document.getElementById("short_code").selectedIndex).text)== "First")
//get the value of the option Fist , how to get the value?
【问题讨论】:
-
你just asked about this。如果答案不起作用,您需要澄清您的问题而不是重新发布。
标签: javascript