Home > DeveloperSection > Forums > How to use bind() and unbind() method in jquery.
Ankit Singh

Total Post:341

Posted on    January-19-2016 10:15 PM

 JQuery JQuery  JavaScript 

 1 Reply(s)
 643  View(s)
Rate this:
I want to use bind() and unbind() method in jquery. how to use this please help me.

aditya kumar Patel

Total Post:254

Posted on    January-19-2016 10:40 PM

bind() and unbind() methods.it will simply attach and unattach code to one or several events on a set of elements.

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
      <script src="Scripts/jquery-2.1.4.js"></script>
    <a  id="bind"  style="text-decoration:none; color:#000; font-size:20px;" href="javascript:void(0);">Bind</a>
<script type="text/javascript">
    $(function () {
        $("#bind").bind("click", function () {

 <br />   <a id="unbind" href="javascript:void(0);" style="text-decoration:none; font-size:20px; color:#000;">Unbind</a>
<script type="text/javascript">
    $(function () {
        $("#unbind").bind("click", function () {
            alert("now disable click event");

Don't want to miss updates? Please click the below button!

Follow MindStick