When passing parameter values, use an "anonymous function" that calls the specified function with the parameters:
e.g. document.addEventListener("click", function() { myFunction(p1, p2); });
document.addEventListener("click", function() { myFunction(p1, p2); });
2.1m questions
2.1m answers
60 comments
57.0k users