JSFiddle - React, Tailwind, and code Playground

HTML

<input id="txtbox"  class="box" type="textbox" />

JavaScript

$(document).ready(function(){
  $("#txtbox").keydown(function(){
    text_changed();
  });
  $("#txtbox").keyup(function(){
    $("#txtbox").css("background-color","pink");
  });
});



function text_changed() {
    $("#txtbox").css("background-color","yellow");
}