triggerHandler method jQuery - Creating personal events

The triggerHandler() method executes one or more jquery methods automatically, but it  must have an associated handler for the concrete event.

Utilization:
$(selector).triggerHandler(event, param1, param2,...);

Example:
We create our own event using the triggerHandler() method. The own event will be created with the on() method and will have the name personal_event. The objective of the example will be to show an SQL statement using parameters passed through input elements.
When the button is pressed, the on() method is used to create its own event, which will collect any two parameters and display them on the screen inside a div element.
It will then make use of the triggerHandler() method to execute its own event unselfishly after the parameters have been collected.

Comments

PHP Captcha


Interesting Articles