I have a Jquery function like the following
function myFunction(){
$.messager.show({
title:\'My Title\',
msg:\'
calling a function is simple ..
myFunction();
so your code will be something like..
$(function(){
$('#elementID').click(function(){
myFuntion(); //this will call your function
});
});
$(function(){
$('#elementID').click( myFuntion );
});
or with some condition
if(something){
myFunction(); //this will call your function
}