jQuery die() Method Last Updated : 11 Jan, 2024 Comments Improve Suggest changes Like Article Like Report jQuery die() method added with the live() method, removes one or more event handlers, for selected elements. Syntax:$(selector).die(event, function) Parameters:event: Specifies one or more than one event handlers to remove. Multiple valid event values are separated by space.function: It is used to specify a function to be removed.Example 1: html <!DOCTYPE html> <html> <head> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"> </script> <script> function changeSize() { $(this).animate({ fontSize: "+=3px" }); } function changeSpacing() { $(this).animate({ letterSpacing: "+=2px" }); } $(document).ready(function() { $("p").live("click", changeSize); $("p").live("click", changeSpacing); $("button").click(function() { $("p").die("click", changeSize); }); }); </script> </head> <body> <center> <p style="color:green;"> Geeks for geeks. </p> <button> added with the live() method, Remove the event handler changeSize(), for p elements </button> </center> </body> </html> Output: Before clicking on the paragraph: After clicking on the paragraph: Example-2: html <!DOCTYPE html> <html> <head> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"> </script> <script> function changeSize() { $(this).animate({ fontSize: "+=3px" }); } function changeSpacing() { $(this).animate({ letterSpacing: "+=2px" }); } $(document).ready(function() { $("h1").live("click", changeSize); $("h1").live("click", changeSpacing); $("button").click(function() { $("h1").die("click", changeSize); }); }); </script> </head> <body> <div> <center> <h1>welcome to GFG</h1> </center> </div> <center> <button>click here</button> </center> </body> </html> Before clicking on the paragraph: After clicking on the paragraph: Comment More infoAdvertise with us Next Article jQuery die() Method J jeetesh16 Follow Improve Article Tags : Web Technologies JQuery jQuery-Methods Similar Reads jQuery dequeue() Method The dequeue() method is an inbuilt method in jQuery that is used to remove the next function from the queue and then it will execute the function. In a queue there will be several functions waiting to run dequeue() used to remove the top function from the queue and execute that function. Syntax: $(s 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 JQuery .Deferred() method This JQuery.Deferred() method in JQuery is a function which returns the utility object with methods which can register multiple callbacks to queues. It calls the callback queues, and relay the success or failure state of any synchronous or asynchronous function.Syntax:jQuery.Deferred([beforeStart])P 2 min read JQuery hasData() method This hasData() method in JQuery is used to determine whether an element has any jQuery data associated with it. This data may be text, event associated with element. There are two examples discussed below: Syntax: jQuery.hasData(element)Arguments: element: This parameter is a DOM element which is to 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 Like