JSFiddle - React, Tailwind, and code Playground
HTML
<input id="input0" autofocus>
<input id="input1">
<pre id="log"></pre>
JavaScript
function log(text) {
document.getElementById('log').appendChild(
document.createTextNode(text + '\n'));
}
$('#input0').bind({
focus: function () { log('--'); },
blur: function () { log('blurred input0'); },
keyup: function (e) {
if (e.which === 38) {
// UP -> jquery
$('#input1').focus();
} else if (e.which === 40) {
// DOWN -> DOM
document.getElementById('input1').focus();
}
}
});
$('#input1').bind({
focus: function () { log('focused input1'); }
});