How to convert keycode to character using javascript [duplicate]

隐身守侯 提交于 2019-11-29 20:49:52
Skilldrick

String.fromCharCode() is what you want:

The fromCharCode() method converts Unicode values to characters.

Syntax

String.fromCharCode(n1, n2, ..., nX)
garsax

As seen here:

String.fromCharCode((96 <= key && key <= 105) ? key-48 : key)
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!