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
WBOYOriginal
2016-05-16 16:36:491251browse

Original binding method:

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

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

Solution: Change the binding method to:

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

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

Statement:
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