JSFiddle - React, Tailwind, and code Playground
HTML
<textarea name="" id="" cols="30" rows="10"></textarea>
<input type="text">
<div contenteditable=true></div>
CSS
*{
border:1px solid;
}
JavaScript
document.onkeypress = function (e) {
alert(e.altKey + " from keypress");
};
/*
document.onkeydown = function(e){
if(e.keyCode !== 18) // if not alt key
alert(e.altKey + " from keydown");
};
*/