let hidden_button = 'hidden-button'
test_button.addEventListener('click', (hidden_button) => {
alert(hidden_button);
myFunc(hidden_button)
})
I want to pass an variable hidden_button
to the handler. But when I do as above and print out the alert, it says hidden_button
is a MouseEvent
.
How do I pass arguments into the handler?
Does whatever in the brackets () =>
refer to the event, which is a click
? I found a few threads talking about addEventHandler
but not the same problem I am looking at.
Thanks.