I want to make an effect that when the user writes, the text that they have to write is marked with a color.
In the following link is what I want to do:
https://www.keytrac.net/en/tryout
...in the ANYTEXT SOLUTION option .
Doing the test, writing, the test text is marked in yellow.
Here I leave a screenshot.
I want you to give me some idea of how to do it, or some example.
You can use the tag
<mark></mark>
you can see the details in Mark tag and the working example it offers. You can also try:
usage example
To dynamically highlight text using the
<mark></mark>
above tag, you can use code like the following:You can see the example working in JsFiddle , or you can hit the run button.
Based on @Arie CwHat's answer, I modified your code to solve my problem, which is to color the text no matter what was typed, just forward.