trigger button click jquery

JavaScript
$("document").ready(function() {
	$("button").trigger('click');
});$("input").trigger("click");$( "#foo" ).on( "click", function() {
  alert( $( this ).text() );
});
$( "#foo" ).trigger( "click" );

$( "#foo" ).on( "custom", function( event, param1, param2 ) {
  alert( param1 + "\n" + param2 );
});
$( "#foo").trigger( "custom", [ "Custom", "Event" ] );$("selector").click(); //or
$("selector").trigger("click");
Source

Also in JavaScript: