typeahead snippets

How to use the typeahead feature of Twitter Bootstrap

Tagged twitter-bootstrap, typeahead  Languages javascript

Example of using the typeahead feature of Twitter Bootstrap:

$('#search input').typeahead({
      source: ['one', 'two'],
      updater: function(item) {
        $('#search').submit();
        return item;
      }
});

Note that the form is submitted after an item is selected from the menu.