Why does my jQuery click handler appear to run multiple times for some of its targets?

前端 未结 7 518
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-11 10:34

I apply:

$(\".newContentLink\").click(function() {
    $(\"#test\").append(\"1\");
});

On this:



        
相关标签:
7条回答
  • 2021-01-11 11:25

    I had a similar problem.... Figured out that I was applying the change function in a loop...i.e. my earlier code was....

    $("table#UserIRTable > tbody > tr").each(function()
    {
       ..............
       ..............
    
      $("input[id='thisMonthSupply']").change(function(e){  
          ......
        });
      ..........
      ..........
    }
    

    took the change function out and bingo... it worked.....

    0 讨论(0)
提交回复
热议问题