0
Jumper Help?
Ok Iâve tried everything. Either I have the red ball but it wonât find btn or everything is black. Iâve moved the curly brackets and retyped it several times and I just do t know what Iâm doing wrong. https://code.sololearn.com/cIrcyHu49bu2/?ref=app
2 Answers
+ 2
There are few problems I find out:
1. You are missing = at line 16, also we add click event with event listeners, for example:
btn.addEventListener("click", ()=> {
// your click function
})
Not btn.onClick()
2. Your btn is not defined it is in scope of onload function, so move ending } from onload at end of js code, so you also wrap code where you set click event on btn
3. In window.requestAnimationFrame(draw);
You are accessing draw but draw dont exist, also this draw should be function.
Make function to draw and assign it to variable or define it with name
There are maybe even more bugs
+ 1
its would be better if u share the html css and js code in a web sandbox, that one is just nodejs. đ