I am attempting to implement a feature where multiple names can be added from an autocomplete drop-down menu to an input field, similar to the example shown below:
https://i.sstatic.net/D4hGA.jpg
Here is what I aim to create:
- Upon selecting an item from the drop-down, it should appear in the input field exactly as depicted in the image.
- If I press backspace in the input field, the entire name should be deleted at once.
- I want to be able to add and store multiple names within the input field.
In essence, each name should be contained within its own box, which will then be housed within the input field itself. How can I achieve this using JavaScript?
I have searched online for a solution, but I may not be using the correct keywords. I am unsure of what this feature is called.