JSFiddle - React, Tailwind, and code Playground

HTML

<input type = "text" autofocus />

JavaScript

function saludo(){
   alert("Hola");
}
$("input").keypress(saludo).blur(saludo);