jquery bootstrap typeahead无法绑定事件

问题描述 投票:0回答:1

我正在使用twitter typeahead而且我无法绑定select事件。我已经看到几乎与此相关的一切,但它还没有奏效。

var subjects = ['PHP', 'MySQL', 'SQL', 'PostgreSQL', 'HTML', 'CSS', 'HTML5', 'CSS3', 'JSON'];
$('#search').typeahead({
    source: subjects
});

$('#search').bind('typeahead:select', function (ev, suggestion) {
    console.log('Selection: ' + suggestion);
});
jquery twitter-bootstrap typeahead
1个回答
0
投票

我通过更新typeahead解决了这个问题,上面的代码在更新后运行良好。

© www.soinside.com 2019 - 2024. All rights reserved.