I'd like to make effect above using input. I can make only change text color no matter what I put into inputbox, not specific letters. I'd like to make specific letters' color change what I write on the inputbox. For example, if I put "hello" into the inputbox, The colors of "H", "E", "L", "L", "O" turn green. here's my code below.
document.addEventListener("input", function() {
document.getElementById('values').style.color = "#999";
});
body {
font-family: sans-serif;
color: #222;
}
<body>
<h1 id="values"><span class="Q">Q</span><span class="W">W</span><span class="R">R</span><span class="T">T</span></h1>
<input type="text" id="inp">
</body>
</html>
