JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="search" />
<input type="button" value="Submit" />
JavaScript
$('input[type=text]').focus(function(){
$(this).css({
'background': '#ccc'
});
}).focusout(function(){
$(this).css({
'background': '#fff'
});
});
$('input[type=button]').click( function(){
$('input[type=text]').css({
'background': '#fff'
});
});