Build search engine which dynamically displays content (Javascript or JQuery)

Hi there! I´m pretty a noob in Front End Development… I need to build search engine which dynamically displays content in Javascript or JQuery. I have an input element in html and should write a function that let me have more or less what you see in the image.

For the moment the content will be added throught plain text (html or js - e.g. an array containing names of cities) and not throught a database connection.
Any advice is welcome…


  1. You could use the .on('change', function(){} to detect when the value of the input has changed.
  2. Then loop through the array and check if indexOf(searchValue.toLowerCase()) returns true
  3. If so show it

Hope this helps a bit.

1 Like

hello @alodavi have a look at this, I think it will do what you are looking for:

JQuery Autocomplete

1 Like

Thank you! Both replies are very helpful!