Hi

What i'm trying to do is to create a custom event. Here is the code snippet

Code:
jQuery.fn.extend({
	        myclick: function (fn) {
		     
               $(this).bind(click,function(e){
                     fn.call(this, e);
                })
        });
I've managed to get it to work by the following


Code:
$('div').myclick(function(e){alert(e)})
but cant seem to get it to work with

Code:
$('div').bind('myclick',function(e){alert(e)})

How do i get the .bind to work in this scenario?

Sorry if this is an easy question. I'm new to JS

Thank you in advance