JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" onfocus="myFunction(this)">

JavaScript

function myFunction(x) {
    x.style.background = "yellow";
}