jQuery delegate() Method

jQuery delegate() method is used to attaches one or more event handlers for specific elements that are child of selected elements. And when the delegate event occurs, specified function will execute.

The delegate() method was deprecated in jQuery 3.0. Use the on() method instead of this.


This syntax represent to the delegate event

$(selector).delegate(childSelector, eventType, eventData, function);
Parameter Type Description
childSelector String Required. Specifies one or more child elements to attach the event handler
eventType String Required. Specifies one or more DOM event types (such as "click" or "dblclick" or custom event names) to attach to the elements
eventData Object Optional. Specifies additional data that will be passed to the event handler
function Function Optional. Specifies the function to execute when the event is occurs


This example represent to the double click event trigger on the selected elements.

<!DOCTYPE html>
  <title>jQuery delegate() method</title>
  <script src="jquery-latest.min.js"></script>
      $( "div" ).delegate( "span", "click", function() {
        $( this ).after( "<p>Paragraph clicked</p>" );
    span {
      cursor: pointer;
    p {
      color: red;
    <span>First paragraph text</span>

Run it...   »