Using e.keyCode || e.which; how to determine the difference between lowercase and uppercase?

后端 未结 5 1954
星月不相逢
星月不相逢 2020-12-20 20:32

I am using e.keyCode || e.which; to determine which key was pressed, but I am getting 65 for both a and A why is this happening and ho

5条回答
  •  爱一瞬间的悲伤
    2020-12-20 21:23

    just use e.which in jquery. They normalize this value for all browsers.

    Additionally you can check for e.shiftKey.

提交回复
热议问题