Good day. In general, I have the following task: there is a field in which the user enters a keyword. And there is a list with keywords, when a user enters a word, only those words that correspond to the entered word remain in the list.
The salt itself is that the list itself should be visible immediately in a separate <div> and when the input of a keyword in <div> begins, the number of words decreases and only the corresponding ones remain.

I roughly have an array of keywords for example:

 var availableTags = [ "ActionScript", "AppleScript", "Asp", "BASIC", "C", "C++", ... и т.д. 

here is the function $("#region").autocomplete({source: availableTags}); - which displays a list of keywords, but it displays it only when the field starts to fill. And displays in the form of a list for the field, but everything should be displayed in a separate <div> ... How can I do this? Thank?

  • Here is an example of what needs to be implemented, just for simpler: tiu.ru Under the logo the inscription "All Russia" - dieselwolf

1 answer 1

The salt itself is that the list itself should be visible immediately in a separate <div>

  • Well, and display the entire list at once.
  • when the user starts typing, then output the appropriate tags.
  • check - if the field is empty, then again put all the tags in the block
  • when the user starts typing, then output the appropriate tags. and can from this place for more? - dieselwolf
  • @dieselwolf, what can I describe in more detail? You compare the combinations of characters typed with words / phrases in your array and those that fall under the filter - output instead of all those that are currently displayed. PS By the way, you can find fairly complete solutions in the internet. For example, such an option , ( more info ) - Deonis
  • Thank. It really helped. - dieselwolf