How do i make a countdown timer?
h
icelite

I need help with making a countdown timer and notification system when it goes off, could anyone help? comment pls if you can!

You are viewing a single comment. View All
Answered by Whacko [earned 5 cycles]
View Answer
Whacko

Using the setInterval() JavaScript code, you can make a countdown.

Whacko

@Ravens0606 K, here's the code with the user input:

Yeesh, that's a lot of code! Sorry I took so long. Does it work?

icelite

ok, thnx! then... what HTML do i do? @JavaMaster1

Whacko

@Ravens0606

It's JavaScript, so you need to use <script>.

Whacko

@Ravens0606 easy peasy, lemon squeezy

icelite
Whacko

@Ravens0606 Did it help? I can give you a code that way a <p> element shows the countdown.

icelite

yes! i would like the <p> pls too! @JavaMaster1

icelite

but thnx! @JavaMaster1

Whacko

@Ravens0606 K, here's the code:

Does it work? I used document.getElementById().

icelite

Im sorry, but it didnt work! @JavaMaster1

Whacko

@Ravens0606 Lemme just double-check my code...
JavaScript isn't easy!

icelite

Ok! and... I agree! @JavaMaster1

Whacko

@Ravens0606 Oops... I used value instead of innerHTML.
Here's the working code:

Now it should work.

Whacko

@Ravens0606 Also, you should practice your JavaScript. This website is really good. It might even help you with html!

icelite

Thanks! Can i alter that in any way and have it like the person using it can choose the set time? @JavaMaster1

icelite
icelite

it works PERFECTLY! Thank you!! @JavaMaster1

Whacko

@Ravens0606 Do I get the cycles?

icelite

yep! you get 5 cycles! @JavaMaster1

Whacko

@Ravens0606 Thanks!