JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text">

JavaScript

$(document).ready(function(){
      $('input[type=text]').focus(function(){
      	$(this).css('background-color', 'black');
      }).focusout(function() {
        $(this).css('background-color', 'white');
      });
});