JSFiddle - React, Tailwind, and code Playground

HTML

<input id="test" />
<br/>
<input id="test2" />
<br/>

JavaScript

$('body').on({
        keyup: function () { _keyup($(this)); },
        focus: function () { _focus($(this)); }
    }, '#test');

function _keyup (element) {
    console.log("test1");
}

function _focus(element) {
    element.blur();
    console.log("test2");   
}

$("#test2").keyup(function() {
    _keyup($(this));
});
$("#test2").focus(function(e) {
    _focus($(this));
});