jQuery - keydown / keypress /keyup ENTERKEY detection?

后端 未结 4 1589
眼角桃花
眼角桃花 2020-12-01 20:23

Trying to get jQuery to detect enter input, but space and other keys are detected, enter isn\'t detected. What\'s wrong below:

$(\"#entersomething\").keyup         


        
4条回答
  •  鱼传尺愫
    2020-12-01 20:59

    I think you'll struggle with keyup event - as it first triggers keypress - and you won't be able to stop the propagation of the second one if you want to exclude the Enter Key.

提交回复
热议问题