【发布时间】:2020-08-16 09:57:15
【问题描述】:
我最近使用了 Jquery UI 自动完成功能,想知道如何在列表顶部添加标题。
到目前为止,这是我的脚本:
$(document).ready(function() {
$('.search').autocomplete({
source: 'search.php',
minLength: 1,
select: function(event,ui) {
var postid = ui.item.id;
if(postid != '') {
location.href = "post/" + postid;
}
}
});
});
我想加<span>Suggestions</span>。
【问题讨论】:
标签: javascript html jquery jquery-ui jquery-ui-autocomplete