Why is my code not working | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why is my code not working

I made a hansum ipsum generator. But it shows me an eror . Uncaught type eror Cannot read property addEventListener of null https://code.sololearn.com/WUfppgedB2iH/?ref=app

13th Oct 2020, 6:11 AM
Çrèàtìvè Sàt
Çrèàtìvè Sàt - avatar
2 Answers
+ 1
Wrap your code starting from line 38 up to line 77 inside a function that should run just after all the necessary elements are ready to use, like this 👇 window.onload = function() { // codes at line 38 ~ line 77 } Further details, see this post 👇 https://www.sololearn.com/post/90825/?ref=app And please, put HTML and JS in the tags instead of a copy of the question title, up there ☝
13th Oct 2020, 7:48 AM
Ipang
+ 2
Thanks Ipang for answering my question. It worked!
13th Oct 2020, 8:23 AM
Çrèàtìvè Sàt
Çrèàtìvè Sàt - avatar