Job Demo
document.onkeyup = KeyCheck; function KeyCheck(e) { var KeyID = (window.event) ? event.keyCode : e.keyCode; switch(KeyID) { case 18: document.Form1.KeyName.value = "Alt";
And your html might be like that
<form name="Form1"> <input type="text" name="KeyName" value="" /> </form>
Note. If you want to get the alt event on a different control / type than change it with your requirements.
Talha source share