jquery create a function and call it code example
Example 1: how to call function in jquery
$(document).ready(function() {
$('#btnSun').click(myFunction);
});
function myFunction() {
alert('hi');
}
Example 2: how to create jquery function
(function( $ ){
$.fn.myfunction = function() {
alert('hello world');
return this;
};
})( jQuery );
$('#my_div').myfunction();