我有7個簡單的選擇框:如何檢查所有選擇框是否使用jQuery選擇了選項?
<select>
<option selected disabled>choose something</option>
<option>some text</option>
<option>some more text</option>
<option>and more and more</option>
</select>
<select>
<option selected disabled>choose something</option>
<option>some text</option>
<option>some more text</option>
<option>and more and more</option>
</select>
<select>
<option selected disabled>choose something</option>
<option>some text</option>
<option>some more text</option>
<option>and more and more</option>
</select>
<select>
<option selected disabled>choose something</option>
<option>some text</option>
<option>some more text</option>
<option>and more and more</option>
</select>
如何檢查是否所有的選擇框有選擇的,而不是默認選項的東西嗎?
哪裏是期權價值? – yash
設置'select'輸入的'value'值....如果未指定value屬性,'text'將被視爲'value' .. – Rayon
您可以通過多種方式獲取Element,例如'document .getElemnetById('HTMLidAttribute')'那麼它可以像測試'Element.selected'一樣簡單。 – PHPglue