Skip to content
Advertisement

why my last.addEventListener(“click”,nextLevel) not working?

https://codepen.io/demi-chen/pen/RwGPgxv

JavaScript

I try to find the lastElementChild in the first div. It does show …… after I use console.log to check. why the addEventListener not working. I click the lastElementChild smile.png face but it’s not working. if function nextLevel() is working. the left&right side should add more smile.png.

Tks!

Advertisement

Answer

its quite a simple fix really change your nextlevel to

JavaScript
Advertisement