[jQuery] append option to select
source : http://stackoverflow.com/questions/170986/what-is-the-best-way-to-add-options-to-a-select-from-an-array-with-jquery $("#select_id").append($("<option></option>").attr("value","option_value").text("text_value")); 清除select中所有value !=0的option $ ( '#select_id option[value!="0"]' ). remove (); 雖然網路上都有,不過還是筆記一下比較方便囉