是否有一种简单的方法可以将文本放入一个完整的字段(https://leaverou.github.io/awesomplete/)?
var input = document.getElementById("inputlist");
alert(input.value);
显示NaN!
答案 0 :(得分:3)
您需要添加awesomplete-select或awesomplete-selectcomplete
事件常规Javascript
var input = document.getElementById("inputlist");
new Awesomplete(input, {list: yourlist});
document.getElementById('inputlist').addEventListener('awesomplete-selectcomplete',function(){
alert(this.value);
});
在Jquery
var input=$("#inputlist")[0];
new Awesomplete(input, {list: yourlist});
$("#inputlist").on('awesomplete-selectcomplete',function(){
alert(this.value);
});