jQuery Event Helper Methods



jQuery also provides a set of event helper method which can be used either to trigger an event to bind any event types mentioned above.

Trigger Methods

The following is an example which would triggers the blur event on all paragraphs −

$("p").blur();

Binding Methods

The following is an example which would bind a click event on all the <div> −

$("div").click( function () {
   // do something here
});

Here are some of the jQuery Event Helper methods:

S. No
Method & Description
1.
blur()
Triggers the blur event of each matched element.
2.
blur( fn )
Bind a function to the blur event of each matched element.
3.
click( )
Triggers the click event of each matched element.
4
click( fn )
Binds a function to the click event of each matched element
5
dblclick( )
Triggers the dblclick event of each matched element.
6.
focus( fn )
Binds a function to the focus event of each matched element.


Updated on: 2020-02-14T12:42:28+05:30

436 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements