JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="input">
<button id="button">Click</button>
JavaScript
document.getElementById('input').onfocusout = function () { console.log("#input lost focus"); }
document.getElementById('button').onfocus = function () { console.log("#button received focus"); }