Home > Web Front-end > JS Tutorial > JQuery solution for binding click events to elements and executing them multiple times_jquery

JQuery solution for binding click events to elements and executing them multiple times_jquery

WBOY
Release: 2016-05-16 16:36:49
Original
1247 people have browsed it

Original binding method:

$("#sdfsd").on("click",function(e){ ***** });
Copy after login

This method will only add new methods to the original click method;

Solution: Change the binding method to:

$("#sdfsd").unbind("click").click(function(e){ ***** });
Copy after login

Unbind the click method bound to the element before binding the new click method

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