how to Bind an event handler to the "click" JavaScript event, or trigger that event on an element. code example
Example 1: jquery click function
$( "#target" ).click(function() {
alert( "Handler for .click() called." );
});
Example 2: on click jquery
$( "#target" ).click(function() {
alert( "Handler for .click() called." );
});