jQuery triggerHandler() Method (original) (raw)
Last Updated : 11 Jul, 2025
The jQuery triggerHandler() Method is used to trigger a specified event for the selected element.
Syntax:
$(selector).triggerHandler(event, param1, param2, ...)
Parameters: This method accepts two parameters as mentioned above and described below:
- event: It is an mandatory parameter which is used to specify the event to trigger for the specified element.
- param1, param2, ... : These are an optional parameters which are used to pass on the event handler and these are especially useful with custom event.
Example 1: This example triggered the input select element.
HTML `
jQuery | triggerHandler() Method<script src=
GeeksForGeeks
jQuery | triggerHandler() Method
Click
<!-- Script to trigger event -->
<script>
$(document).ready(function () {
$("input").select(function () {
$("input").after(" TRIGGERED!");
});
$("button").click(function () {
$("input").triggerHandler("select");
});
});
</script>
`
Output:
Example 2: This example trigger the paragraph event and display the alert message.
HTML `
jQuery | triggerHandler() MethodGeeksForGeeks
jQuery | triggerHandler() Method
Click<!-- Script to trigger events -->
<script>
$(document).ready(function () {
$("button").click(function () {
$("button").on("myPara", function (event,
param1, param2, param3) {
alert(param1 + "\n" + param2 + "\n" + param3);
});
$("button").triggerHandler("myPara",
['GEEKS', 'FOR', 'GEEKS']);
});
});
</script>
`
Output:

