JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" onfocus="myFunction(this)">
JavaScript
function myFunction(x) {
x.style.background = "yellow";
}
<input type="text" onfocus="myFunction(this)">
function myFunction(x) {
x.style.background = "yellow";
}