+ 3

Javascript help needed

I am learning JavaScript, i am trying to create a code to move 4 boxes to left right top bottom.... please tell me where i am wrong and help to create this... advance thanks for your time https://code.sololearn.com/WbfaX4K2OcW6/?ref=app

15th Jan 2018, 9:42 AM
jatin verma
jatin verma - avatar
2 Answers
+ 16
https://code.sololearn.com/WXD70oT12cYa/?ref=app
15th Jan 2018, 10:04 AM
Swapnil Srivastava
Swapnil Srivastava - avatar
+ 16
Bugs: You used top+1 instead of top+=1 You used element.style.right and .bottom but are reducing their value instead of increasing them. Suggestion: Use only 2 of .right .left .top and .bottom . Otherwise things might be unexpected.
15th Jan 2018, 10:10 AM
Swapnil Srivastava
Swapnil Srivastava - avatar