+ 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 Respuesta
+ 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