You can use trigger function of jQuery.
Code sample is given below:
Html Code:
<input type="text" value="Hello World"><br><br>
<button>Trigger the select event for the input field</button>
</br></br>
Script:
$("input").click(function(){
$("input").after(" Text marked!");
});
$("button").click(function(){
alert("This is a alert");
$("input").trigger("click");
});
For more learning have a look here.
http://www.w3schools.com/jquery/event_trigger.asp[
^]
https://learn.jquery.com/events/triggering-event-handlers/[
^]