JSFiddle - React, Tailwind, and code Playground
HTML
<input id="input" type="text"></input>
JavaScript
console.log("W", "W".charCodeAt());
function logIt(evt) {
console.log(evt, String.fromCharCode(evt.charCode), evt.charCode);
}
var input = document.getElementById("input");
input.addEventListener("keypress", logIt, false);