get ascii value when key pressed js code example Example: corresponding text to key code js String.fromCharCode(e.keyCode)