top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What is Delegate() and Trigger() in Jquery?

0 votes
385 views
What is Delegate() and Trigger() in Jquery?
posted May 25, 2018 by anonymous

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

0 votes

Delegate
The delegate() method attaches one or more event handlers for specified elements that are children of selected elements and specifies a function to run when the events occur.

Event handlers attached using the delegate() method will work for both current and FUTURE elements

Note: It's deprecated in Version 3. Please start using on() instead.

Trigger
The trigger() method triggers the specified event and the default behavior of an event (like form submission) for the selected elements.

This method is similar to the triggerHandler() method, except that triggerHandler() does not trigger the default behavior of the event.

answer Nov 30, 2018 by Nikita Sehgal
...