Home > Web Front-end > JS Tutorial > How to remove click event through jquery

How to remove click event through jquery

coldplay.xixi
Release: 2020-11-30 10:39:06
Original
5768 people have browsed it

How to remove click events through jquery: first add a button in html; then use jquery to add a click event to the button; finally use jquery's unbind method to remove the event.

How to remove click event through jquery

The operating environment of this tutorial: Windows 7 system, jquery version 3.2.1. This method is suitable for all brands of computers.

How to remove click events through jquery:

1. We first add a button to the html.

How to remove click event through jquery

#2. Then use jquery to add a click event to the button.

How to remove click event through jquery

3. To delete the added event, we just use jquery’s unbind method to remove the event. Add: unbind() to the code. method call.

How to remove click event through jquery

4. Of course, all the events of the button are removed above. If your button is bound to multiple events, such as click event, mouseover event, etc., As long as we remove the click event, we can write that "click" is what we want to remove in the first parameter of the method.

How to remove click event through jquery

5. To run the page, we are clicking the button on the page.

How to remove click event through jquery

#6. After clicking, you can see an alert box popping up, indicating that an event has been added.

How to remove click event through jquery

7. When we close the pop-up box and click the button again, we will find that the prompt box no longer pops up because the event has been removed.

How to remove click event through jquery

Related free learning recommendations: javascript (video)

The above is the detailed content of How to remove click event through jquery. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template