[Solved] I need help may someone please explain why my setinterval is acting goofy? [closed]

To make this more clear since you seem to be having some trouble: you redefined moved inside your interval, so every time it runs, it gets set back to 100. You need to initialize that outside the interval. function moveAllTriangles(){ var spike = document.getElementById(“spike”); var moved = 100; function moveTriangle(){ spike.style.left = (750 – moved) … Read more