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

15th Aug 2025, 1:49 PM
ShadowCatSoulYT
ShadowCatSoulYT - avatar
1 Antwort
+ 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
15th Aug 2025, 3:08 PM
Lisa
Lisa - avatar