.delegate() in jQuery

It helps to attach a handler to one or more events for all elements that match the selector, now or in the future, based on a specific set of root elements.

.delegate()

// To add a paragraph(s) dynamically. When click on existing and added paragraph, it will create new paragraph(s).

$( “body” ).delegate( “p”, “click”, function() {
    $( this ).after( “<p>New paragraph!</p>” );
});