Calling a function with params onclick
I'm trying to call a function with a param. As i have it now the function gets called on load, how can i make it wait for the user to click and still have my param?
3 Replies
You need to use an arrow function:
JS (and most other languages) invoke a function when
()
are included, so you're invoking a function they returns another function which is what's run when the button is clickedThanks!
This is a similar issue you had the other day, I had mentioned all this to you. I would spend some time with it make sure you understand what's happening.