Example

Trigger the select event of an input element:

$("button").click(function(){
  $("input").triggerHandler("select");
});

Try it yourself »

Definition and Usage

The triggerHandler() method triggers specified event types for selected element.

The triggerHandler() method is similar to the trigger() method. Except that it does not trigger the default behavior of an event (like form submission) and it only affects the first matched element.


Trigger an Event

Specifies an event to trigger for the selected element.

Syntax

$(selector).triggerHandler(event,[param1,param2,...])

Parameter Description
event Required. Specifies the event to trigger for the specified element.
[param1,param2,...] Optional. Additional parameters to pass on to the event handler.