2 Replies Latest reply: Jul 26, 2011 4:07 PM by pchinique RSS

    I have this 24 hour countdown javascript but I need to remove something from it and I don't know how

    pchinique Community Member

      I found this javascript that is perfect for what I want but it displays the actual date on top of the countdown. Can any one help me to remove this date or hide it some how?

       

      Thanks

       

       

      <head>
      <script type="text/javascript">
      function ShowTimes() {
      var now = new Date();
        var hrs = 23-now.getHours();
        var mins = 59-now.getMinutes();
        var secs = 59-now.getSeconds();
        var str = '';
           str =    now.toString();
            str += '<br>0 days '+hrs+' hours '+mins+' minutes '+secs+' seconds';
        document.getElementById('countdownToMidnight').innerHTML = str;
      }
      /*var _cntDown;
      function StopTimes() {
          clearInterval(_cntDown);
      }*/

       

      </script>
      </head>

       

      <body onload="_cntDown=setInterval('ShowTimes()',1000)">
      <div id="countdownToMidnight"></div>
      <!--<button onclick="StopTimes()">Stop</button>-->
      </body>