Why dont working | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
20th Aug 2022, 2:00 PM
Zulpakar
Zulpakar - avatar
2 ответов
+ 1
It's a loading order issue: By the time the js is loaded, the html isn't fully loaded yet, that's why the js code doesn't find the html element. A way to solve it is to wrap the js inside window.onload = () => { // here goes your code... } ⭐⭐⭐ IF SOMETHING IS NOT WORKING please describe WHAT is not working, what error you get and how it is supposed to work/ look ⭐⭐⭐
20th Aug 2022, 4:48 PM
Lisa
Lisa - avatar
0
Thanks Lisa the code is working 🙏
20th Aug 2022, 7:25 PM
Zulpakar
Zulpakar - avatar