JQuery UI click event fires twice on keypress

后端 未结 3 1932
情书的邮戳
情书的邮戳 2021-01-16 05:39

HTML


JS

$(\'#clickMe\')         


        
3条回答
  •  不知归路
    2021-01-16 05:44

    Because hitting "Enter" when focus is on a button triggers the "click" event natively. You also get a "keypress" event, and from that you trigger the "click" event again.

提交回复
热议问题