是否有可能是有selectedIndex
返回-1如果沒有被選中,而不是元素的文字位置0返回的SelectedIndex從選擇元素
另外,selectedIndex
返回0,即使沒有被選中。
<select id="qwe" name="qwe">
<option>11</option>
<option>22</option>
</select>
document.someForm.qwe.value
//returns 11
$('#qwe option:selected').val()
//returns 11
<select id="qwe" name="qwe">
<option selected="false">11</option>
<option>22</option>
</select>
$('#qwe option:selected').val()
//returns 11
<select id="qwe" name="qwe">
<option selected="false">11</option>
<option selected="false">22</option>
</select>
$('#qwe option:selected').val()
//returns 22
將添加到列表中。 – Derek