autocomplete feature written in JavaScript