chosen.jquery.min.js动态添加下拉内容
1、引入chosen.jquery.min.js文件
2、使用ajax赋值
$(".chosen-select").chosen();
optHtml = "";
$.each(data, function (i,v) {
optHtml += '<option value="' + v.UserId + '">' + v.UserName + '</option>';
})
$(".chosen-select").append(optHtml);
$(".chosen-select").trigger('chosen:updated');
3、html
<select data-placeholder="请选择..." class="chosen-select form-control" multiple tabindex="4" id="TId" style="height:100px;"></select>
微信号:jamesworkshop 学习QQ群:364976091
浙公网安备 33010602011771号