gpt4 book ai didi

javascript - 在下拉列表的第一行添加自定义文本

转载 作者:行者123 更新时间:2023-11-30 21:21:12 26 4
gpt4 key购买 nike

 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&nbsp;' + 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();
}

我想在下拉列表的第一行中添加自定义文本。我如何添加这个请给我建议。

提前致谢。

最佳答案

您可以像这样使用 jquery。

$(function(){
var content='Choose your emotion';
$("<li disabled>"+content+"</li>").prependTo("ul.chosen-results");
});

关于javascript - 在下拉列表的第一行添加自定义文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45167033/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com