JSFiddle - React, Tailwind, and code Playground

HTML

<body id="target">
    <h1>Capturing key events</h1>
    <p id="p2"></p>
</body>

JavaScript

function typing(target) {
    $('#p2').text('Character: ' + String.fromCharCode(event.keyCode));
}


$(function() {
    $('#target').bind('keyup', typing);
});