+ 1

Why are the height and width not decreasing each time i click on the dom element? they get decreased only once.

https://code.sololearn.com/WJv8jgC30MrX/?ref=app

27th Mar 2021, 6:35 AM
Ayoob Saad
Ayoob Saad - avatar
2 Respostas
+ 5
https://code.sololearn.com/WHhpK48PxYRw/?ref=app NOTE - see line no 21 and 23 of your code, it tells that when the paragraph is clicked ,set the value of num to 300 , so whenever you click on paragraph num because 300 and then divide by 2 and in another click also it became 300 , so num you have to declare before part of event so that the number will decrease .
27th Mar 2021, 6:47 AM
Abhiyantā
Abhiyantā - avatar
+ 1
Thank you so much, problem solved, i declared num outsite the block
27th Mar 2021, 6:49 AM
Ayoob Saad
Ayoob Saad - avatar