JSFiddle - React, Tailwind, and code Playground

HTML

<form>
    <input id="target1" type="text" value="Keypress"><br/>
        <input id="target2" type="text" value="Blur"><br/>
            <input id="target3" type="text" value="Keyup"><br/>
</form>
<div id="other">Trigger the handler</div>

JavaScript

$( "#target1" ).keypress(function() {
  alert( $(this).val() );
});
$( "#target2" ).blur(function() {
  alert( $(this).val() );
});
$( "#target3" ).keyup(function() {
  alert( $(this).val() );
});