JavaScript console | SoloLearn: Learn to code for FREE!

+1

JavaScript console

Why EventListener is not working in JS section of SoloLearn PlayGround

5/29/2018 8:54:04 AM

Gopi Chand

4 Answers

New Answer

+14

I think Hatsy Rei meant to post the link of your code with the question. Anyways, I checked your code and found the solution :D and that is "Wrap your JS code in a window.onload function" Example ~ window.onload = function (){ // all code here } Also note that you didn't define the "btn" variable for the anything so it will show errors

+6

Post your code here so that the community can try to help you debug your stuff?

+2

Thanks a lot Nikhil :)

+1