There is an Input field into which text is entered, and, depending on the text entered, a drop-down list is displayed.

Something like this should look like:

picture

How to implement it?

  • one
    Please give more information. An example of the entered text and the corresponding list. What should happen if the entered text has no corresponding elements in the speaker, etc. - cyadvert

1 answer 1

As I understand it, you need the idea of ​​implementation, and not the code itself (if the code itself, then the question should be closed - this is work for the author). The idea is about the following:

  1. The drop-down list is a select element.
  2. We put event handlers on the input element. I think at least keypress (keystroke), maybe change (depends on what you need) and other events to track text changes.
  3. When in the input field is the text that we need (you know better), and it is checked for each change, then you need to change the select javascript'om, namely add / remove option elements that are responsible for a set of options in the drop-down list.

Actually, that's all. If you need any clarification, then write in the comments.

UPD: You noticed the GO to button. If you need to click on it to change the drop-down list, then text change event handlers are generally not needed.