0

I know there's a way to do it but I can't find it! In my very early html writing days (2007) I found a simple code for searching by specified search words. Meaning- the user inputs a word into the search box, and the site searches for it in an array within it. It could even find results for letters and word fragments. I can't find something like that now...

Is the a way to specify an array and use JS or JQuery to search it even if the search word isn't exact? similar to MySQL's LIKE?

user3187759
  • 187
  • 1
  • 16
  • http://stackoverflow.com/questions/5424488/javascript-search-for-a-string-inside-an-array-of-strings – zavg Sep 22 '14 at 15:46

2 Answers2

0

If you have the input, and the full list of searchable value, you could compute the Levenshtein distance to do a "sort-of" LIKE ; libs like https://github.com/gf3/Levenshtein could help...

phtrivier
  • 13,047
  • 6
  • 48
  • 79
0

This should give you what you want.

http://jqueryui.com/autocomplete/

user432350
  • 161
  • 9