N
N
Nick Bukovskiy2018-02-25 16:58:57
JavaScript
Nick Bukovskiy, 2018-02-25 16:58:57

How to pass event along with other parameters to the function?

document.querySelector('#color').addEventListener('click', activeEl('clr', 'color'));


Let's say there is such a code. I pass the parameters I need to the activeEl function and + I need to pass the EVENT object.

I understand that you can do this
document.querySelector('#color').addEventListener('click', event =>{....});

but how to pass it to a function with other parameters?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Egor Zhivagin, 2018-02-25
@sonterix

If I understood correctly
Well, pick up the third argument in the activeEl function itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question