0
I need to fix this 👆. Please I need a help...
3 Réponses
+ 1
Wrap it on a document "load" or "DOMContentLoaded" event.
https://developer.mozilla.org/en-US/docs/Web/API/Document/DOMContentLoaded_event
https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
Scripts placed at head must be delayed after body is processed, instant where DOM is ready.
document.addEventListener ("DOMContentLoaded", function(event) {
//Your code goes here
});
here an example... (look at the end of js document)
https://code.sololearn.com/W3LC4249YM17/?ref=app
If this helps you remember mark this answer as good for solving
0
I have problem with the JavaScript not the HTML...
The project is in my PC, I put that code snippet in Sololearn for help!
0
Ok let me try that one