【发布时间】:2011-08-09 13:01:30
【问题描述】:
我有一个选择字段和一个按钮:
<select id="mylist"></select>
<input type="button" id="btn" value="update">
我的js代码:
var btn=$('#btn');
btn.click(function(){
var optionList = GET_LIST();// GET_LIST() returns a array of strings which is the option texts.
//How to use optionList to update the options in <select> ?
});
如何在选择标签中使用optionList 更新我的选项列表?
【问题讨论】:
-
它返回一个字符串数组,即选项文本
-
“更新”选项是什么意思?您想如何更新它们?
-
@Ryan,表示
标签: javascript jquery jquery-ui jquery-selectors jquery-events