Here's a scenario: a text paragraph is displayed alongside an input box. The user must type the same text into the input box as shown in the paragraph.
I'm aiming to highlight the paragraph text in color as the user types, to demonstrate progress. However, I'm uncertain about how to accomplish this using HTML and CSS.
My current strategy involves using a tag (likely a span) for each word in the text. Then, as the user enters the text, I would continuously add a color class. If there exists a more effective method of achieving this, I would greatly appreciate any insight.
An illustrative example can be seen on typing practice websites such as