Copyright ©

jQuery - triggerHandler( event, [data] ) Method

previous next



The triggerHandler( event, [data] ) method triggers all bound event handlers on an element (for a specific event type) WITHOUT executing the browser's default actions, bubbling, or live events.

This method behaves very similarly to the trigger method, with two major exceptions:

This method returns the return value of the triggered handler instead of a chainable jQuery object.


Here is the simple syntax to use this method:

selector.triggerHandler( event, [data] )


Here is the description of all the parameters used by this method:


Following is a simple example a simple showing the usage of this method:

<title>the title</title>
   <script type="text/javascript" 
   <script type="text/javascript" language="javascript">
   $(document).ready(function() {


   <button id="old">.trigger("focus")</button>
   <button id="new">.triggerHandler("focus")</button><br/><br/>
   <input type="text" value="To Be Focused"/>

To understand it in better way you can Try it yourself.

previous next

Copyright ©