This article mainly introduces the trigger () method usage in jQuery. it analyzes the functions and definitions of the trigger () method and the usage tips for triggering events of specified types of matching elements, for more information about how to use the trigger () method in jQuery, see the following example. Share it with you for your reference. The specific analysis is as follows:
This method triggers events of the specified type of matching element.
Syntax structure 1:
Specifies the event type triggered by the matching element.
The code is as follows:
$ (Selector). trigger (event, param1, param2 ,...)
Parameter list:
| Parameters |
Description |
| Event |
Specifies the event to be triggered by the specified element. It can be a custom event (attached using the bind () function) or any standard event. |
| Param |
Optional. Additional parameters passed to the event handler. Additional parameters are particularly useful for custom events. |
Instance code:
The code is as follows:
Trigger () function-script House