Mik*_*zco 1 jquery typeahead.js
我正在使用typeahead.js作为自动完成字段.无论是否在自动完成列表中,我都需要在输入中获取值.
这可能吗?
我该怎么做?
这可能是一个新问题吗?
尝试
$(".typeahead").typeahead({/* typeahead options */})
.on("input", function(e) {
// do stuff with current `typeahead` `value`
var myVal = e.target.value; // `$(e.target).typeahead("val")
console.log(myVal)
});
Run Code Online (Sandbox Code Playgroud)
jsfiddle http://jsfiddle.net/2reurafk/1/
| 归档时间: |
|
| 查看次数: |
2035 次 |
| 最近记录: |