I am struggling to phrase this question properly and unable to find the solutions I need on Google. When searching, it only provides information on how to add an entire background color to a textbox, which is not what I am looking for. What I aim to achieve are results similar to the image linked below:
https://i.sstatic.net/1g4Ch.png
The goal is to add a background color to each individual character within an input
tag, excluding spaces. As the user types inside the input
tag, the characters should be highlighted with a background color but not the spaces.
Currently, I do not have any code as I am unsure of how to implement this using CSS or JavaScript if necessary. All I have is an
<input type="text">
My intuition tells me that JavaScript may be the solution, but I am uncertain of how to proceed (despite having knowledge of JS). How can I accomplish this task?