I wish when user click on Resend Button then the again setInterval() restart. https://code.sololearn.com/Wh2iQk06AOl0/?ref=app
6/22/2018 12:50:11 PM
Satish Kumar Sharma2 Answers
New AnswerHere I fixed the code. I have comments made so you can see exactly what I changed. First off, you need to make the button visible again once you hide it. You also need to reset the variable "t" in order for your timer to reset. https://code.sololearn.com/W2uC293nx4nt/?ref=app
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.
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message