function my_function_name() { console.log('get it'); }
var eventname = 'click';
var functionname = 'my_function_name';
document.getElementById('test').addEventListener(eventname, functionname);
If I run those script, I get the following error: "Uncaught TypeError: EventTarget.addEventListener: Argument 2 is not an object."
What I have to do, that I can pass the second parameter of addEventListener as a variable?