consider this function:
jQuery.fn.MyFunction = function (event) {
alert(this.text());
}
I want to call it in two ways:
$('#myElement').bind('click', MyFunction );
and
$("#myOtherElement").click(function (event) {
//some processing
this.MyFunction(event);
}
What is the correct way to declare myFuntion to allow for both of these scenarios?
here is the jsfiddle http://jsfiddle.net/4Z4fQ/5/ but I seem to have jsfiddle issues with binding to my start button also.
Here is a jsfiddle of it working.
The main issue you were having is that you never added your closing parenthesis when you bind the click event to
myOtherElementHtml
js