Hi Hiba,
On the button click, make sure to clear the created interval (i.e. timer) by executing the clearInterval method.
Note that, you will have to pass the id returned from the setInterval method invocation, to the clearInterval method as an argument.
clearInterval(intervalId);
Based on your implementation you will have to store the interval variable value (i.e. id returned from setInterval() method invocation ) in a local variable and pass the same value as the argument to the clearInterval method.
I hope this helps you!
Kind regards,
Benjith Sam