I don't know if the question is clear enough. I think an example is easier to understand. I want to do the following:
Instead of directly calling the object method, like this:
$("#input").changed(function(){ //do something })
or this:
$("#input").keyup(function(){ //do something })
I want to have a single function that can dinamically change the object's method that is being called, like this:
function foobar(callback){ $("#input").callback(function(){ //do something }) } foobar("keyup") foobar("changed")