matcher
is an option in the parameter for the typeahead
function. From the documentation:
The method used to determine if a query matches an element. It takes a single argument, an element with which to check the request. Access the current query with this.query. Returns boolean true if the request is a match.
So it looks something like this:
$('.typeahead').typeahead({ matcher: function(item) {
The documentation also says that the default behavior for this callback is case insensitive
. So, your need should be solved out of the box.
source share