可能重複:
Check if option is selected with jQuery, if not select a default檢查選項被選中
我有HTML這樣的:
<div id="somedivid">
<select class="someclass">
<!-- options -->
</select>
<select class="someclass">
<!-- options -->
</select>
</div>
如果兩個選擇框,選擇選項如何檢查?
編輯:我不能改變HTML,所以它意味着我不能添加ID來選擇元素。
我所做的就是寫你的問題的話題+「jQuery的」谷歌和[看我找到了什麼(HTTP ://stackoverflow.com/questions/149573/check-if-option-is-selected-with-jquery-if-not-select-a-default) – Tom
@湯姆,你找到解決方案時,只有一個選擇元素。我知道該怎麼做。 – SomeoneS