How to highlight just one letter in a input element using css and vanilla js

Viewed 195

inm trying to make basically a typing speed webpage.

So the user needs to type a sentence as fast as they can. But i want to check for any wrong letters in an input field. If its wrong, the letter should highlight red.

The thing is I dont know how to highlight just 1 letter in a input field element.

In case someone doesnt understand, lets say the user needs to copy the sentence below

Hello World

But they write: Gello World

It should highlight in red the G since its the wrong letter.

0 Answers
Related