JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="k1" />

JavaScript

$('input').keydown(function(e){
      
        $("#reffield").css( { backgroundColor:"red" } );
  
});