This article mainly introduces how to remove events using DOM in JQuery, and involves the unbind method in jQuery to remove event bindings, for more information about how to remove DOM events in JQuery, see the following example. Share it with you for your reference. The details are as follows:
You can bind multiple events to the same element, or bind the same event to multiple elements. Assume that there isUse the following code to bind multiple identical events to the element.
$ (Function () {$ ('# btn'). bind ("click", function () {$ ('# test'). append ("My binding function 1
");}). Bind (" click ", function () {$ ('# test'). append ("My binding function 2
");}). Bind (" click ", function () {$ ('# test'). append ("My binding function 3
");});})
1. Remove the previously registered event from the button Element
Let's take a look at the following code and click "delete all events" to delete the above btn events: