// param {id:'buttonId', action : function(event[,param1, param2] ){}, behavior:function(event[,param1, param2] ){} }
CustomButton = function(parameters) {
var buttonElement = document.getElementById(parameters.id);
// how can I utilize the passed action function from
// parameters and include additional parameters like function(event[,param1,param2])
buttonElement.onclick = parameters.action;
}
I am currently working on creating a customized toggle button that functions as a link. I would like to be able to add events as described above but I am struggling with implementing them for the buttons in order to use code similar to the example below:
new CustomButton({id: 'button1', "action" : function(event, parameter1, parameter2){
//function body
}
});