There is a function defined as follows:
menu[0].onclick = function() {
filters.reset_all();
clients.get();
}
This function gets called when the user clicks on the first menu element. Now, I need to invoke this function from another place and here's what I have done:
if (li.onclick) { // li and menu[0] refer to the same element
li.onclick.call();
}
It works perfectly fine.
However, now I want to pass some parameters to the onclick
function. I tried using .call(some_param);
but the arguments
array in the onclick
function remains empty.
What am I missing?
edit: I made the following change:
menu[0].onclick = function(arg) {
console.log(arg);
filters.reset_all();
clients.get();
}
and also
li.onclick.call(li, param);
but still no success.