开发者

The handler in click button keeps adding everytime I refresh my page

开发者 https://www.devze.com 2023-03-21 10:02 出处:网络
I use jquery to bind a click event in my link element and binding a handler. But every time I refresh the page the registration of the handler in m开发者_如何学运维y link element keeps adding. Like fo

I use jquery to bind a click event in my link element and binding a handler. But every time I refresh the page the registration of the handler in m开发者_如何学运维y link element keeps adding. Like for example, in a new load page, only one handler registered in the click but when I click the link again, it it will add another handler.

Please advise.

Many thanks.

$("#btn").click(function () {
  $("#blck").slideToggle("fast", function(){
  });
});


It seems to work fine. You must be withholding vital information:

http://jsfiddle.net/2A78D/

0

精彩评论

暂无评论...
验证码 换一张
取 消