JSFiddle - React, Tailwind, and code Playground
HTML
<input type="text" id="t" value="0" />
JavaScript
$('#t').focus();
$('#t').blur(function () {
if ($('#t').val() != "") {
$('#t').val(parseInt($('#t').val()) + 1);
alert("foo");
$('#t').focus();
}
});