How to make Javascript countdown for 24 hours and fade out a div element after 24 Hours?

Here, I’ve made a timer which says how much time is left for 24 Hours. But it’s showing Hours, Minutes and seconds in negative value for seconds after a minute and negative value for minutes after an Hour. I need the both div elements (“offer1” and “remainingTime”) should fade out after 24 hours timer. By using the current Date and getTime() I should show the time remaining Here is the JSFiddle Link https://jsfiddle.net/Manoj07/d28khLmf/2/… Thanks for everyone who tried to help me. And here is the answer https://jsfiddle.net/Manoj07/1fyb4xv9/1/ Answer createCountdown returns a countdown object with two methods: start and stop. A