onclick & function | Sololearn: Learn to code for FREE!

+2

onclick & function

Why "y.onclick=function cfr()" not working? Am I not correctly calling the function? https://code.sololearn.com/WaW0uMFEgKb1/?ref=app

12/24/2017 11:58:20 AM

Илья Ланин

3 Answers

New Answer

+2

Use y.addEventListener("click",cfr); or y.onclick=cfr; instead of y.onclick=cfr();

+1

thank you, Mohammed!

+1

You're welcome, Илья