SOLVED how to call a jQuery Function without a click or clicking it

by sebababi

HTML

<div id="foo">foo click</div>

JavaScript

$( "#foo" ).on( "click", function() {
  alert( $( this ).text() );
});

$( "#foo" ).trigger( "click" );