0

Can you help me getting rid of a error please I m a beginner .

Javascript error https://code.sololearn.com/WqIE9mKl859H/?ref=app

10th May 2020, 7:36 PM
Shubham Thakur
Shubham Thakur - avatar
6 odpowiedzi
+ 2
Put all your javascript inside window.onload = function (){ } Also you need to use # for referring to id using document.querySelector() https://code.sololearn.com/WP9Rx4jqg5SH/?ref=app
10th May 2020, 7:59 PM
Bhavya
Bhavya - avatar
+ 2
You can leave the result function outside of the window.onload function, since you're using the HTML elements onlick= attribute. This way it will be in scope. Otherwise, handle it similar to your start button. You can actually leave your start function itself outside of the window.onload too as the addeventlistener function will have access to it from within the onload function, but it will also work from within it.
10th May 2020, 8:30 PM
ChaoticDawg
ChaoticDawg - avatar
+ 1
I fixed some of your code but there are still issues try to debug yourself
10th May 2020, 8:03 PM
Bhavya
Bhavya - avatar
+ 1
Thankyou so much for clarifying the things..🙂
10th May 2020, 8:34 PM
Shubham Thakur
Shubham Thakur - avatar
0
Ok
10th May 2020, 8:00 PM
Shubham Thakur
Shubham Thakur - avatar
0
Thankyou so much for help..😊
10th May 2020, 8:04 PM
Shubham Thakur
Shubham Thakur - avatar