Get key value of a key pressed

后端 未结 8 2292
别那么骄傲
别那么骄傲 2021-01-05 01:14

I don\'t find how to get the value of a key pressed. I currently have

$(\'#info_price\').bind(\'keydown\',function(evt){
    alert(evt.keyCode);
         


        
8条回答
  •  被撕碎了的回忆
    2021-01-05 01:19

    Chrome and Opera today have Read only property data in event object.

    It is written on MDN that currently this feature is "Working Draft".

    https://developer.mozilla.org/en-US/docs/Web/API/InputEvent/data

提交回复
热议问题