trigger() Method - Javascript jQuery Method and Property

Javascript examples for jQuery Method and Property:trigger


The trigger() method triggers the events for the selected elements.


Parameter RequireDescription
event Required. event to trigger.
param1,param2,... Optional. Additional parameters to pass on to the event handler.

The following code shows how to trigger the select event of an <input> element:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<script src=""></script>
        $("input").after(" Select event triggered!");
    });//from  w ww  .j a  va  2s .c  om

<input type="text" value="Hello World"><br><br>

<button>Trigger the select event for the input field</button>


Related Tutorials