SyntaxFix
Write A Post
Hire A Developer
Questions
You could also set onclick to call your function like this:
foo.onclick = function() { callYourJSFunction(arg1, arg2); };
This way, you can pass arguments too. .....