如何通过jquery设置组合框的数据源
data={"a","b","c","d"}
。和ComboBox.datasource=data;
==> by jquery
答案 0 :(得分:0)
http://plugins.jquery.com/plugin-tags/combobox
$(document).ready(function() {
var data = ["a", "b", "c", "d"];
var options;
$.each(data, function(i, item ) {
options += "<option value='" + item + "'>" + item + "</option>";
});
$("#combobox").append(options).combobox();
});
<select id="combobox"></select>