Example of Count Down timer in Java Script

<!DOCTYPE html>

<html>
<head>
    <title>encode and decode</title>
    <script type="text/javascript" >
        function Timercount(second,outwin) {
         
            var stat = document.getElementById(outwin);
            stat.innerHTML = "Please wait for " + second + "seconds";
            if (second < 1) {
                clearTimeout(timervalue);
                stat.innerHTML = '<h3> CountDown Complete</h3>';
            }
            second--;
            var timervalue = setTimeout('Timercount(' + second + ',"' + outwin + '")', 1000);

        }
     
    </script>
</head>
<body>
<div id="first"></div>
<script type="text/javascript">Timercount(10,"first");
</script>

</body>
</html>

Code Generate the following output

Example of Count Down timer in Java Script
Example of Count Down timer in Java Script
Example of Count Down timer in Java Script Example of Count Down timer in Java Script Reviewed by Jacob Lefore on April 06, 2015 Rating: 5

No comments