即使很难创建多选下拉列表...它也没有显示在ui / screen ....我正在使用这个插件http://www.erichynds.com/blog/jquery-ui-multiselect-widget
var mymultiselect = $(document.createElement("select")).attr("multiple","multiple").addClass("multiselect").multiselect();
mymultiselect.append('<option>"blah"</option');
mymultiselect.append('<option>"bloh"</option');
答案 0 :(得分:1)
尝试以下代码
var mymultiselect = $(document.createElement("select")).attr("multiple","multiple").addClass("multiselect");
mymultiselect.append('<option>"blah"</option');
mymultiselect.append('<option>"bloh"</option');
$('body').append(mymultiselect); // create ur select element
$(".multiselect").multiselect(); // then initialize ur plugin
注意:dont forget to link multiselect plugin to your code