keypress and keyup - why is the keyCode different?

后端 未结 3 2025
闹比i
闹比i 2020-11-28 07:00

Related: JavaScript KeyCode vs CharCode

Here is some code you can try at home or in a jsfiddle:

el.addEventListener( \'keyup\', function( e ) { 
             


        
3条回答
  •  我在风中等你
    2020-11-28 07:40

    There is a good article on quirksmode.org answering exactly that question. You might also want to look at Unixpapa's results.

提交回复
热议问题