determine which key is pressed

后端 未结 4 774
南方客
南方客 2021-01-29 14:42

How to determine which key is pressed in javascript?

4条回答
  •  故里飘歌
    2021-01-29 14:57

    in the function which takes the key event:

    function(e){
       var key = String.fromCharCode(e.keyCode);
    }
    

提交回复
热议问题