unbind(type , data ): Without any arguments, all bound events are removed. : unbind « jQuery « JavaScript DHTML






unbind(type , data ): Without any arguments, all bound events are removed.

 
<html>
  <head>
    <script type="text/javascript" src="js/jquery-1.3.2.js"></script>
    <script type="text/javascript">
        $(document).ready(function(){
                
            function aClick() {
              alert("action");
            }
            $("#bind").click(function () {
              $("#myButton").click(aClick).text("Binded");
            });
            $("#unbind").click(function () {
              $("#myButton").unbind('click', aClick).text("Not Binded");
            });

        });
    </script>

  </head>
  <body>
    <body>
          <button id="myButton">Not Binded</button>
          <button id="bind">Bind Click</button>
          <button id="unbind">Unbind Click</button>
       
                         
    </body>
</html>

   
  








Related examples in the same category

1.Unbind all events from
2.Unbind all live events from all paragraphs
3.Unbind event
4.To unbind all click events from all paragraphs
5.To unbind just one previously bound handler, pass the function in as the second argument: