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

21st Dec 2022, 5:17 PM
Moxie Devereaux
Moxie Devereaux - avatar
2 ответов
+ 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
21st Dec 2022, 6:13 PM
PanicS
PanicS - avatar
+ 1
its would be better if u share the html css and js code in a web sandbox, that one is just nodejs. 👍
21st Dec 2022, 5:32 PM
arturop200
arturop200 - avatar