1
我有簡單的選擇,看起來像這樣:的jQuery刪除所有的選擇元素與價值
<select id="region">
<option value=""> -- country -- </option>
<option value="842554592">Alberta</option>
<option value="708812360">Ontario</option>
...
</select>
我想清楚了非空值,我想知道,如果jQuery有這個簡單的方法。我正在使用:
$('.country').find('option[value!=""]').remove();
這看起來有點難看。謝謝!