---
title: "How to use bind() and unbind() method in jquery."  
description: "How to use bind() and unbind() method in jquery."  
author: "Anonymous User"  
published: 2016-01-19  
updated: 2016-01-19  
canonical: https://www.mindstick.com/forum/33896/how-to-use-bind-and-unbind-method-in-jquery  
category: "jquery"  
tags: ["jquery", "javascript"]  
reading_time: 1 minute  

---

# How to use bind() and unbind() method in jquery.

I want to use bind() and unbind() [method in jquery](https://www.mindstick.com/forum/156655/trim-method-in-jquery). how to use this please help me.

## Replies

### Reply by Anonymous User

\
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"><head>    <title></title>      <script src="Scripts/jquery-2.1.4.js"></script></head><body>    <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 () {            alert($(this).text());        });    });</script> <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 () {            $("#unbind").unbind("click");            alert("now disable click event");        });    });</script></body></html>
```

![How to use bind() and unbind() method in jquery.](https://www.mindstick.com/mindstickforums/afd287a4-0228-4ae9-ac7f-445b40436792/images/7e085363-91b3-4b41-823e-308c3cfe1e3e.png)


---

Original Source: https://www.mindstick.com/forum/33896/how-to-use-bind-and-unbind-method-in-jquery

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
