JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text">
JavaScript
$(document).ready(function(){
$('input[type=text]').focus(function(){
$(this).stop().animate({
backgroundColor: '#000'
}, 1000); // Koniec funkcji animate.
}, function() {
$(this).stop.animate({
backgroundColor: 'rgba(0,0,0,0)'
}, 1000); // Koniec funkcji animate.
}); // Koniec funkcji focus.
}); // Koniec funkcji ready.