【发布时间】:2015-09-23 20:16:43
【问题描述】:
我正在尝试在 selectize.js 中设置要选择的选项,该怎么做。
最初可以设置一些选项。那我该如何设置值。
<select id="selectize">
</select>
var options=[
{value:0, text:"option 0"},
{value:1, text:"option 1"},
{value:2, text:"option 2"},
{value:3, text:"option 3"},
];
$('#selectize').selectize({
"options":options
});
$('#selectize').change(function(){
//$('#result').html("you select value="+$(this).val());
$('#selectize').val(1);
});
请在jsfiddle中找到代码
谢谢,
【问题讨论】:
标签: javascript html selectize.js