O'Reilly logo

Instant typeahead.js by Toby Osbourn

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Manipulating data (Become an expert)

In some cases our system might be set up in such a way that we never want or need to hit the server to perform searches, but we may want to update the search data locally based on user input.

Getting ready

Our scenario for this recipe is a Beer search engine which has been pre-populated with a couple of known beers, but also has the option for our user to add their own.

We will be editing our index.html file for the first time in a while, and we will be editing our custom.js with some jQuery that will update our list of beers each time the user submits a new one. If you aren't aware of jQuery's syntax or how the .click event works you might want to consider reading up on it, but I will walk you through it here. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required