I'm replacing inline event handling with EventListners in the JS file. I'm stuck on one of the form
onclick="funcMain(func1(document.getElementById('foo')), func2(document.getElementById('bar'))"
since I can't do
document.getElementById('offendingInlineElement').addEventListener.('onclick', funcMain('document.getElementById('foo')), func2(document.getElementById('bar'), false)
How can I pass arguments to the function funcMain
?
Out of curiousity when a function is past like this is it known as a function pointer or is this something else?