Input Fires Keypress Event Twice

后端 未结 8 2212
小蘑菇
小蘑菇 2021-02-18 14:26

This question has been asked/answered (mostly) before, BUT I\'ve tried three things to stop the event from bubbling but nothing has worked:

return false;
e.stopPr         


        
8条回答
  •  梦毁少年i
    2021-02-18 14:50

    What do you think is catching the event when it bubbles. I only get one firing with this test page.

    
    
      
        Scratch
        
        
      
      
    
        

    Maybe it's your selector. Is it nested inside another .addTag? When I change the jQuery selector and also make the div and input the same class I start to get two events firing. Like this:

    $('.thing').show().keyup(...);
    

    ...and...

提交回复
热议问题