jQuery delegate() Method Last Updated : 11 Jul, 2025 Summarize Comments Improve Suggest changes Share Like Article Like Report jQuery delegate() Method in jQuery is used to add one or more event handlers to the specified element that are children of selected elements and is also used to specify a function to run whenever the event occurs. Syntax:$(selector).delegate( childSelector, event, data, function )Parameters: This method accepts four parameters as mentioned above and described below: childSelector: It is a required parameter and is used to specify one or more child elements attached to the event handler.event: It is a required parameter and is used to specify one or more events attached to the elements. Multiple event values are separated by space and it must be a valid event.data: It is an optional parameter and is used to specify the additional data to pass along the function.function: It is a required parameter and is used to specify the function to run when the event occurs.Example 1: html <!DOCTYPE html> <html> <head> <title> delegate() Method in jQuery </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <!-- jQuery script to add events --> <script> $(document).ready(function () { $("div").delegate("h3", "click", function () { $("h3").css("background-color", "green"); }); }); </script> </head> <body> <center> <h1>Welcome to GeeksforGeeks!</h1> <p> Click on the below element (lightgreen background) to change background-color </p> <div style="background-color:lightgreen;"> <h3>GeeksForGeeks</h3> </div> <h3>GeeksForGeeks.</h3> </center> </body> </html> Output: Example 2: html <!DOCTYPE html> <html> <head> <title> delegate() Method in jQuery </title> <script src= "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"> </script> <!-- jQuery script for delegate() method --> <script> $(document).ready(function () { $("div").delegate("h3", "click", function () { $(this).slideToggle(); }); $("button").click(function () { $("<h3>This show how the delegate Method" + " works .</h3>").insertAfter("button"); }); }); </script> </head> <body> <center> <h1>Welcome to GeeksforGeeks!.</h1> <div style="background-color:green"> <h3>GeeksforGeeks.</h3> <h3>The delegate Method.</h3> <button>Click</button> </div> </center> </body> </html> Output: Comment More infoAdvertise with us Next Article jQuery clone() Method A adeshsingh1 Follow Improve Article Tags : Web Technologies JQuery jQuery-Methods Similar Reads 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 clone() Method The clone() method is an inbuilt method in jQuery that is used to make a copy of selected elements including its child nodes, text, and attributes. Syntax: $(selector).clone(true|false)Parameters: This method accepts an optional parameter that could be either true or false specifying whether the eve 2 min read jQuery.fn.extend() Method This jQuery.fn.extend() method is used to merge the contents of an object onto the jQuery prototype to provide new jQuery instance methods. Syntax: jQuery.fn.extend( object ) Parameters: This method accepts single parameter as mentioned above and described below: object: This parameter holds the obj 2 min read jQuery ajax() Method The jQuery ajax() method is used to perform asynchronous HTTP requests, allowing you to load data from a server without reloading the webpage. It provides a flexible way to interact with remote servers using GET, POST, or other HTTP methods, supporting various data formats.Syntax:$.ajax({name:value, 4 min read jQuery ajaxComplete() Method The ajaxComplete() method is used to specify a function to be run when an AJAX request completes. Syntax: $(document).ajaxComplete(function(event, xhr, options))Parameter: event: It contains the event object. xhr: It contains the XMLHttpRequest object. options: It contains the used options in AJAX r 2 min read jQuery bind() Method The jQuery bind() method is used to attach one or more event handlers for selected elements. This method specifies a function to run when an event occurs. Syntax$(selector).bind(event, data, function);ParametersIt accepts three parameters that are described below: event: This is an event type that 2 min read Like