I know that you can add new jQuery functions by $.fn.someFunction = function()
However, I want to add functions to specific elements only. I tried this syntax and it doesn't work $('.someElements').fn.someFunction = function()
I want to do this so that I can call the function like this somewhere in the code $('someElements').someFunction();
$('.someElements')and call the function as that variable plus.someFunction()later.var someElements = $('.someElements'); someElements.myFunc = function() { /* code here */ };