if (this.is_multiple) {
this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="' + this.default_text + '" class="default" autocomplete="off" placeholder="choose your ' + this.default_text + '" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"><li class="choose"></li></ul></div>');
} else {
this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>' + this.default_text + '</span><div><b></b></div></a><div class="chosen-drop"><div class="chosen-search"><input type="text" autocomplete="off" /></div><ul class="chosen-results"></ul></div>');
}
this.form_field_jq.hide().after(this.container);
this.dropdown = this.container.find('div.chosen-drop').first();
this.search_field = this.container.find('input').first();
this.search_results = this.container.find('ul.chosen-results').first();
this.search_field_scale();
this.search_no_results = this.container.find('li.no-results').first();
if (this.is_multiple) {
this.search_choices = this.container.find('ul.chosen-choices').first();
this.search_container = this.container.find('li.search-field').first();
} else {
this.search_container = this.container.find('div.chosen-search').first();
this.selected_item = this.container.find('.chosen-single').first();
}
我想在下拉菜单的第一个li中添加自定义文字。我如何添加这个请给我一些建议。
提前致谢。
答案 0 :(得分:1)
你可以像这样使用jquery。
$(function(){
var content='Choose your emotion';
$("<li disabled>"+content+"</li>").prependTo("ul.chosen-results");
});