What's the easiest way to define a new jQuery member function?
So that I can call something like:
$('#id').applyMyOwnFunc()
Please see Defining your own functions in jQuery:
In this post i want to present how easy define your own functions in jQuery and using them.
From the post:
jQuery.fn.yourfunctionname = function() {
var o = $(this[0]) // It's your element
return this; // This is needed so others can keep chaining off of this
};
Used:
$(element).yourfunctionname()