![]() ![]() Ive tried to stop a timer by clearInterval() but Im not sure if it is called properly. ![]() Here In my form $num_questions contains a value of no.of questions user have entered through form, Basically the timer should be set for the value entered by user in no.of questions field but instead its is directly come to 0:00 just after clicking submit the form and redirect to form, I cant understannd how to fix this. I want to stop a timer by clicking a button but I cant find the exact way. Var minutes = Math.round((seconds - 30)/60), We initialize minutes using constant and time using let in JS. ![]() And also created some JS functions for the countdown. Output: In the above code, we have created anelement with an ID attribute inside the HTML body section. Here is my javascript code for countdown timer Live Preview: See the Pen Countdown timer by Wonderdevelop ( wonderdevelop) on CodePen. Fundamentals of a Countdown Timer
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |