JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="textbox" name="plaintext" onKeyUp="checkKey()">

JavaScript

function checkKey() {
var plaintext = document.getElementById("textbox");
if(plaintext.value != 'test') {
      plaintext.style.color = "#FF0000";
}
else {
      plaintext.style.color = "#66CD00";
   }
}