I'm not able to run a code, where I create a function separately and call it whenever you want, but only changing the parameters. Javascript does not execute
function minhaFuncao(num1, num2) { //codigo } variavel.onclick = minhaFuncao(num1, num2);
How do I make it work? It just works if I write the function name without the parameters, type:
variavel.onclick = minhaFuncao;
But I would like to pass parameters to the function after the "onclick".