jQuery: textbox keyup firing twice

前端 未结 8 1864
南笙
南笙 2021-01-11 16:09

I\'m having a textbox and assigned the following function (it\'s the only function assigned):

txt.bind(\"keyup\",function(event){
    if(event.keyCode==13)
          


        
8条回答
  •  星月不相逢
    2021-01-11 16:54

    I had the same problem. Though i could not find a solution yet, i found the reason why it is triggering twice.

    I am handing the event if the entered text has "@".For this i am listing each key stroke. To enter '@' you need two key precesses (@+shift) and that is the reason it is triggering twice.

提交回复
热议问题