I want to restart countdown. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

I want to restart countdown.

I wish when user click on Resend Button then the again setInterval() restart. https://code.sololearn.com/Wh2iQk06AOl0/?ref=app

22nd Jun 2018, 12:50 PM
Satish Kumar Sharma
Satish Kumar Sharma - avatar
1 Answer
+ 2
I had a quick glance, you will need to set your timer ( t variable ) back to 5 after functions is executed so it can go again from 5. Otherwise it stays at 0 so it will never start again as condition is not met.
22nd Jun 2018, 1:22 PM
damyco
damyco - avatar