jQuery | off() Method Last Updated : 27 Feb, 2019 Comments Improve Suggest changes Like Article Like Report The off() Method in jQuery is used to remove event handlers attached with the on() method. The off() method brings a lot of consistency to the API and it replace unbind(), die() and undelegate() methods. Syntax: $(selector).off(event, selector, function(eventObj), map) Parameter: This method accepts four parameters as mentioned above and described below: event: It is required parameter and used to specify one or more events or namespaces to remove from the selected elements. Multiple events are separated by space. selector: It is optional parameter and used to match with the one originally passed to the on() method when attaching event handlers function(eventObj): It is optional parameter and used to specify the function to run when the event occurs. map: This parameter is used to specify the event map ({event:function, event:function, ...}) which contains one or more event attach to the elements, and functions to run when the events occur. Example 1: This example removes the event handler. html <!DOCTYPE html> <html> <head> <title> jQuery off() method </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <!-- Script to remove event handler --> <script> $(document).ready(function() { $("h3").on("click", function() { $(this).css("background-color", "green"); }); $("button").click(function() { $("h3").off("click"); }); }); </script> </head> <body> <h3>GeeksforGeeks</h3> <button> Click to remove event handler </button> </body> </html> Output: Before Click on the element h3: After Click on the element h3: Example 2: This example use animate event to add animation effect one time and then remove the event handler. html <!DOCTYPE html> <html> <head> <title> jQuery off() method </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <!-- Script to animate the event --> <script> $(document).ready(function() { var x = 0; $("h3").click(function(event) { $("h3").animate({fontSize: "+=10px" }); x++; if (x >= 1) { $(this).off(event); } }); }); </script> </head> <body style="text-align:center;"> <h1>Welcome to GeeksforGeeks!.</h1> <div style="background-color:green;"> <h3> Geeks for Geeks. Click to increase the size (only one time) </h3> </div> </body> </html> Output : Before Click on the heading: After Click on the heading: Comment More infoAdvertise with us Next Article jQuery | off() Method A adeshsingh1 Follow Improve Article Tags : Web Technologies JQuery jQuery-Events Similar Reads jQuery stop() Method The stop() method is an inbuilt method in jQuery which is used to stop the currently running animations for the selected element. Syntax: $(selector).stop(stopAll, goToEnd);Parameters: This method accepts two parameters as mentioned above and described below: stopAll: It is optional parameter and th 2 min read jQuery | unload() Method The unload() method in jQuery is used to perform unload event when the user try navigates away from current webpage.The event can be triggered when user changes the dynamic state of the page for example user clicked on link to leave the page, a new URL is typed in the address bar etc. the unload met 2 min read JQuery when() method This JQuery.when() method in JQuery  gives a way to execute callback functions depending on zero or more Thenable objects, which usually are Deferred objects that represent asynchronous events.Syntax:jQuery.when(deferreds)Parameters:deferreds: This parameter specifies zero or more Thenable objects.R 1 min read jQuery | unbind() Method The unbind() Method is an inbuilt method in jQuery which is used to remove any selected event handlers. This method can be used to remove particular event handler, or stop specific functions. It works on any event handler using an event object. Note: If no parameters are provided, the method works o 2 min read jQuery click() Method jQuery click() is an inbuilt method that starts the click event or attaches a function to run when a click event occurs. Syntax:$(selector).click(function);Parameters: It accepts an optional parameter "function" which is used to run when a click event occurs. jQuery examples to show the working of 2 min read Like