Click here to Skip to main content
15,917,702 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
This is the code, with java :
Will be thankful if anyone helps:)

<div>
Registration closes in <span id="timer">Countdown starts now!</span> minutes!
</div>

<script>
window.onload = function(){
var day= 3
var hou= 24
var min = 1;
var sec = 3;
setInterval(function(){

document.getElementById("timer").innerHTML = day +" : " + hou +" : " + min +" : " + sec ;
sec--;
if(sec == 00)
{
min--;
sec = 60;

if (min == 00)
{
hou--;
min=60;

if (hou = 00)
{
day--;
hou=24;

}
},1000);
}
</script>
Posted
Comments
Peter Leow 16-Mar-15 8:54am    
This is JavaScript, not Java. They are not the same.

 
Share this answer
 
Check below programm, it may be help you.

XML
<span id="countdown" class="timer"></span> <script> var seconds = 60; function secondPassed() {     var minutes = Math.round((seconds - 30)/60);     var remainingSeconds = seconds % 60;     if (remainingSeconds < 10) {         remainingSeconds = "0" + remainingSeconds;       }     document.getElementById('countdown').innerHTML = minutes + ":" + remainingSeconds;     if (seconds == 0) {         clearInterval(countdownTimer);         document.getElementById('countdown').innerHTML = "Buzz Buzz";     } else {         seconds--;     } }   var countdownTimer = setInterval('secondPassed()', 1000); </script>
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900