当悬停/关注项目结果时,如何覆盖在输入上显示项目标签的默认行为?
示例不起作用:
JavaScript:
$('#ac').autocomplete({
source : ["hello", "how", "do", "you", "do"],
focus: function(event, ui){
console.log("print")
$(this).val('my custom label to show in input');
}
})
HTML:
<input type="text" id="ac"/>