The callbacks.empty() method in jQuery is used to remove all the callbacks from a list. It returns the Callbacks object onto which it is attached.
Parameters: It does not accept any parameter.
Return Value: This method returns the Callbacks object onto which it is attached.
Below examples illustrate the callbacks.empty() method in jQuery:
Example 1: In this example, the fun1 function is first added to the callbacks list and all the callbacks present are executed in the list with a given argument. The callbacks.empty() method is executed to empty the list. The second function fun2 is added and the callbacks list is executed again. This demonstrates the emptying of the list after adding the first function.
Example 2: This example provides a button to empty the callback list and then add the given function to see the result of emptying the callbacks list.
- jQuery | jQuery.fx.interval Property with example
- jQuery | jQuery.fx.off Property
- jQuery | jQuery.support Property
- jQuery | jquery Property
- jQuery UI | position() Method
- JQuery | parseHTML() method
- jQuery | add() method with Example
- jQuery | not() method with Examples
- jQuery | ajaxStart() Method
- JQuery UI | Progressbar method
- jQuery | get() Method
- jQuery | fadeIn() Method
- jQuery | delegate() Method
- jQuery | outerHeight() Method
- jQuery | event.isDefaultPrevented() Method
- jQuery | outerWidth() Method
- jQuery | before() Method
- jQuery | off() Method
- jQuery | html() Method
- jQuery | triggerHandler() Method
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.