I have a prototype function such as event.
Prototype
Func("input_element_id").event("keyup",function(){
alert("Works on keyup in an Input!");
}
Func.prototype= {
keyup: function(func){
//adding event listener and callback using func
},
event: function(e,func) {
//what to do here to call function "keyup"
}
};
The prototype name is in the variable e. But how can i call that function using the variable name?
I am doing this, so that passing "keyup keydown" will add keyup and keydown listeners, which is better than calling each prototype function individually.
Thanks.