JSFiddle - React, Tailwind, and code Playground
HTML
<textarea style="width:100%">function should fire when the next input is tabbed into or clicked (focused), but not when changing browser tabs</textarea>
<input>
JavaScript
var times = 0;
$('input').on('focus', function() {
times ++;
$(this).after('<br>Focused '+times+' times');
});