0
can't understand an error
i cannot understand what's wrong with my code, there is some error on line 11 but i can't understand what the error means, chatgpt isn't helping at all, please somone explain to me https://sololearn.com/compiler-playground/WYT7BcadMJuk/?ref=app
1 Odpowiedź
+ 5
Javascript can only find the html elements once DOM is loaded. Wrap the JS in
windows.onload = () { ...}
Also, I used Javascript to attach the click event to the button.
See example:
https://sololearn.com/compiler-playground/WWMAuhQc9e5N/?ref=app