Web
Analytics
Jquery Unbind Method Example | Angular | ASP.NET Tutorials

For Consultation : +91 9887575540

Stay Connected :

To remove standard handlers or custom handlers, we simply pass the unbind() method the handler name or custom handler name that needs to be removed

jQuery(‘a’).unbind(‘click’).

If no parameters are passed to unbind(), it will remove all





 

handlers attached to an element.

<!DOCTYPE html>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title></title>
<script src=”Scripts/jquery-2.2.3.js”></script>
<script>
$(document).ready(function () {
$(“#btn1”).bind(“click”,function() {
alert(‘Hello button is clicked’);

})
$(“#btn_disable_Click”).click(function(){
$(“#btn1”).unbind(“click”);
})
});
</script>

</head>
<body>
<input type=”button” id=”btn1″ name=”btn1″ value=”Click Here” />
<input type=”button” name=”btn_disable_Click” id=”btn_disable_Click” value=”Disable Click Event” />
</body>
</html>

Output

Output Output