Handle selected event in twitter bootstrap Typeahead?
问题 I want to run Javascript function just after user select a value using twitter bootstrap Typeahead . I search about some thing like selected event. 回答1: $('.typeahead').on('typeahead:selected', function(evt, item) { // do what you want with the item here }) 回答2: $('.typeahead').typeahead({ updater: function(item) { // do what you want with the item here return item; } }) 回答3: For an explanation of the way typeahead works for what you want to do here, taking the following code example: HTML