Cancellation method: 1. Use the off() function, which can remove the event handler added through on(). The syntax is "event-bound element.off()"; 2. Use unbind () function, this function can delete the event handler added by any jq method, the syntax is "event-bound element.unbind();".
The operating environment of this tutorial: windows7 system, jquery1.10.2 version, Dell G3 computer.
jquery cancels on() bound events
Method 1: Use off() function
The off() function is usually used to remove event handlers added through the on() method.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
2. Use the unbind() function
The unbind() function removes the event handler of the selected element.
ubind() works with any event handler attached via jQuery.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
|
[Recommended learning: jQuery video tutorial, web front-end video】
The above is the detailed content of How to cancel the event bound by on() in jquery. For more information, please follow other related articles on the PHP Chinese website!