Error with addEventListener | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 2

Error with addEventListener

the function of my addEventListener run alone ???? btnUn.addEventListener('click', fctGood (error, good, q, i, rUn, rDeux, rTrois, rQuatre, rGood) ); I think we should remove the paranthĆØse but i need then to keep the variable ??? Could you help me ?

2nd Mar 2019, 9:57 AM
Alexis
Alexis - avatar
1 Resposta
+ 7
Use bind function to bind the parameters btnUn.addEventListener('click', fctGood.bind(null, error, good, q, i, rUn, rDeux, rTrois, rQuatre, rGood) ); PS. Please set the proper relavent title of this question
2nd Mar 2019, 10:11 AM
CalviÕ²
CalviÕ² - avatar