JSFiddle - React, Tailwind, and code Playground

HTML

<div id="div" style="height:50px;width:100px;border:1px solid red;" class="ui-widget-content" tabindex="0"></div>
<input id="input">


<div id='test'></div>

JavaScript

$('#div,#input').keypress(function(event){
    $('#test').text(event.keyCode+ ' who: '+this.id);
});