I know that you can add new jQuery functions by $.fn.someFunction = function()
$.fn.someFunction = function()
However, I want to add functions to specific elements only. I tried this
Yo, needed to do the same thing, came up with this. its nice cause you destroy the element and function goes poof! I think...
var snippet=jQuery(".myElement"); snippet.data('destructor', function(){ //do something }); snippet.data('destructor')();