![]() |
VOOZH | about |
jQuery is an open-source JavaScript library that simplifies the interactions between an HTML/CSS document, or more precisely the Document Object Model (DOM), and JavaScript. Elaborating the terms, simplifies HTML document traversing and manipulation, browser event handling, DOM animations, Ajax interactions, and cross-browser JavaScript development.
The delegate() Method in jQuery is used to add event handlers to the element that are children of selected elements. When the event occurs then the function will be run. This will work for current and future elements (if we want to create some elements later).
Syntax:
$(selector) .delegate(childSelector, event, data, function)
Parameters: This function accepts four parameters.
Example: The following code demonstrates the delegate() method in jQuery.
Output:
Reference: https://api.jquery.com/delegate/