+ 1
Aim shooter
I can’t find the error in my code. There’s supposed to be 5 boxes moving but none of them are moving and is just a blank screen. https://code.sololearn.com/W0v3Op5P5vsZ/?ref=app
9 Antworten
+ 2
Your Mom Read the message error. It tells a lot.
Then read about getElementById method.
You're trying to use in JS a reference only present in HTML.
+ 2
Please don't delete the code. When you do so then all the comments posted become useless.
+ 1
In general, the code is too confusing and repetitive, making it difficult to debug. Some questions:
1. Line 4 seems invalid. What is its purpose?
let time = document.getElementById("timer").innerHTML = timer--;
2. There are 5 identical functions for the boxes. Why are them separated, instead of a single one with box as a parameter?
3. How is the code supposed to behave?
My advice is to take a step back and think the logic. Maybe it just got too far before being well structured, and this makes it hard for you.
0
What JS reference is that?
0
Why is my timer not working?
https://code.sololearn.com/W0v3Op5P5vsZ/?ref=app
0
Nevermind i figured it out
0
Emerson Prado why is my clearTimeout not working
https://code.sololearn.com/W0v3Op5P5vsZ/?ref=app
0
Okay, so ye i tried re doing it and still not working for some reaosn
https://code.sololearn.com/W0v3Op5P5vsZ/?ref=app
0
Your Mom I still think a step back would be the best now. I'm struggling a lot to follow the logic, and can't figure what the code should do.
Can you explain how this should work?