+ 2
Why the backward button is not working????
Please help me. https://code.sololearn.com/WCYNF0iOuHaa/?ref=app Edit: I have fixed my code! Thanks to JaScript .
5 Answers
+ 8
// A better way will be referencing to the same position and variable:
let f = 1;
const fwd = () =>{
f+=5;
document.getElementById("div").style.left=f+"px";
}
const bwd = () =>{
f-=5;
document.getElementById("div").style.left=f+"px";
}
+ 5
Thank you JaScript ! I came to know my mistake and fixed my code☺☺
+ 3
Happy coding Arjun Dawande
+ 1
I see it's working now.
0
Yes Freezer Pardon , I fixed it.