set datasource for combobox
how to set datasoure of com开发者_开发技巧bobox by jquery
data={"a","b","c","d"}
. and ComboBox.datasource=data;
==>by jquery
Are you looking for this using this plugin
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>
精彩评论