Why the backward button is not working???? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

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 .

1st Oct 2023, 11:07 AM
Web Developer AD
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"; }
1st Oct 2023, 11:57 AM
JaScript
JaScript - avatar
+ 6
Thank you JaScript ! I came to know my mistake and fixed my code☺☺
1st Oct 2023, 2:19 PM
Web Developer AD
+ 3
Happy coding Arjun Dawande
2nd Oct 2023, 6:20 AM
JaScript
JaScript - avatar
+ 1
I see it's working now.
2nd Oct 2023, 12:37 PM
Freezer Pardon
Freezer Pardon - avatar
+ 1
Yes Freezer Pardon , I fixed it.
2nd Oct 2023, 1:23 PM
Web Developer AD