I have two divs in my app and I want them to have custom functions with the same signature, but with different actions, so that I could store the "current" div in a variable, and just call something like:
and have the corresponding methods fired up.
myCurrentDiv.theFunction(someEventData);
How can I do that using jQuery?
I tried doing something like:
$("#myFirstDiv").theFunction = function() {
alert("theFunction on firstDiv");
}
$("#mySecondDiv").theFunction = function() {
alert("theFunction on secondDiv");
}