JSFiddle - React, Tailwind, and code Playground

HTML

<input type="text" id="test" />

JavaScript

$("#test").keypress(function(e){
    if (document.all){ var evt = event.keyCode;}
    else if(e.which) { var evt = e.which;}           
    else{              var evt = e.charCode;}
    
    if (evt == 13){ // with any other key, the alert dos not fire
        alert(evt);
    }
    return true;
});