12th May 2023, 4:57 AM
Leonard
2 odpowiedzi
+ 5
Modify line 1 in JS to: onload=()=>{ document.getElementById('solve').addEventListener("click", function(){ at last line put } at end explanation: 1. why use "document.getElementById('solve')"? if you just use solve without explicitly referencing it through document.getElementById(), the code will look for a global variable named "solve". 2. Why use "onload=()=>{...}"? The onload event is used to ensure that all of the resources required by a web page are loaded and ready before executing any JavaScript code.
12th May 2023, 5:03 AM
Just Some Random Guy
Just Some Random Guy - avatar
+ 3
Thx it's really helpful
12th May 2023, 5:28 AM
Leonard