JSFiddle - React, Tailwind, and code Playground

JavaScript

document.onkeypress =  zx;
    function zx(e){
        var charCode = (typeof e.which == "number") ? e.which : e.keyCode
        console.log(charCode);
    }