How to use unbind and bind event in javascript
Microsoft Net Framework

How to use  unbind and bind event in javascript

 

1. bind()

 

$("#BoxId").bind("click", (function () {

$('span').text("Single Clicked");

}));

 

2. unbind()

Unbind or detached the existing events is quite easy, just need to specified the attached event type.

 

Detached the “click” and “dblclick” event from elements with an Id of “BoxId”.

 

$('#BoxId').unbind("click");

$('#BoxId').unbind("dblclick");

 

 

 

bind unbind same time

 

 

for form  submit

 

 $("#CrudRateTierItem").unbind("submit").bind("submit", function (e) { });

 

 

for button cick

 

 

 $("#CrudRateTierItem").unbind("click").bind("click", function (e) { });

Avantages:

it will disable multiple clicks and multiple form submission

Share This with your friend by choosing any social account


Upcoming Articles
You may also read following recent Post
Copyright Future Minutes © 2015- 2024 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM
03
07

New Messages

George Floyd
  • Edit Post Edit This Post within a Hour
  • Hide Chat Hide This Post
  • Delete Chat If inappropriate Post By Mistake
  • Report Inappropriate Chat
  • 4.5kb
  • Hi James! Please remember to buy the food for tomorrow! I’m gonna be handling the gifts and Jake’s gonna get the drinks
  • Hi James! Please remember to buy the food for tomorrow! I’m gonna be handling the gifts and Jake’s gonna get the drinks
  • Hi James! Please remember to buy the food for tomorrow! I’m gonna be handling the gifts and Jake’s gonna get the drinks