+ 1
Why are the height and width not decreasing each time i click on the dom element? they get decreased only once.
2 Answers
+ 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 .
+ 1
Thank you so much, problem solved, i declared num outsite the block