JQuery binds the element to a click event that executes multiple times
- 2020-03-30 03:09:08
- OfStack
Original binding method:
This method simply continues to add new methods to the original click method;
The solution changes the binding method to:
Unbind the click method bound to the element before binding the new click method
$("#sdfsd").on("mouseout",function(e){ ***** });
This method simply continues to add new methods to the original click method;
The solution changes the binding method to:
$("#sdfsd").unbind("click").click(function(e){ ***** });
Unbind the click method bound to the element before binding the new click method