Best practice/standards-compliant way to get character code of pressed key

后端 未结 0 1904
温柔的废话
温柔的废话 2021-01-04 04:16

Now that e.keyCode is deprecated, what should I do if I need the character code of a key press?

 if (e.key.charCodeAt() === 97) 

is this okay

相关标签:
回答
  • 消灭零回复
提交回复
热议问题