Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8141861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T12:39:00+00:00 2026-06-06T12:39:00+00:00

I am making a contest platform ..For it I need a countdown timer ..The

  • 0

I am making a contest platform ..For it I need a countdown timer ..The problem is that I donno JS ..So I googled up and got this script for the timer..But It is not working in the webpage…Please help me out..
Here is the code for the timer…I am getting the box for the div tag but not the timer in it…Please help me coz I am complete new bie in JS..

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
        <title>CoBo:Contest</title>
        <link href="css/master.css" rel="stylesheet" type="text/css"/>
        <script>
          function start(myD, myH, myMins, mySecs, myL) {
              var d = new Date();//  Returns the Day (number) so we can set it to default
              currentDay = d.getDate();
              var month = 0;//  '*' for next month, '0' for this month or 1 through 12 for the month 
              var day = myD;//  Offset for day of month day or + day  
              var hour = myH;//  0 through 23 for the hours of the day
              var minutes = myMins;//  Minutes of the hour to End on
              var seconds = mySecs;//  Seconds of the minute to End on
              var tz =  - 7;//  Offset for your timezone in hours from UTC
              var lab = myL;//  The id of the page entry where the timezone countdown is to show
              displayTZCountDown(setTZCountDown(month, day, hour, minutes, seconds, tz), lab);
          }

          function setTZCountDown(month, day, hour, minutes, seconds, tz) {
              var toDate = new Date();
              if (month == '*')
                  toDate.setMonth(toDate.getMonth() + 1);
              else if (month > 0) {
                  if (month <= toDate.getMonth())
                      toDate.setYear(toDate.getYear() + 1);
                  toDate.setMonth(month - 1);
              }
              if (day.substr(0, 1) == '+') {
                  var day1 = parseInt(day.substr(1));
                  toDate.setDate(toDate.getDate() + day1);
              }
              else {
                  toDate.setDate(day);
              }
              toDate.setHours(hour);
              toDate.setMinutes(minutes - (tz * 60));
              toDate.setSeconds(seconds);
              var fromDate = new Date();
              fromDate.setMinutes(fromDate.getMinutes() + fromDate.getTimezoneOffset());
              var diffDate = new Date(0);
              diffDate.setMilliseconds(toDate - fromDate);
              return Math.floor(diffDate.valueOf() / 1000);
          }

          function displayTZCountDown(countdown, tzcd) {
              if (countdown < 0)
              document.getElementById(tzcd).innerHTML = "<b>Ended</b>";
              else {
                  var secs = countdown % 60;
                  if (secs < 10)
                  secs = '0' + secs;
                  var countdown1 = (countdown - secs) / 60;
                  var mins = countdown1 % 60;
                  if (mins < 10)
                  mins = '0' + mins;
                  countdown1 = (countdown1 - mins) / 60;
                  var hours = countdown1 % 24;
                  var days = (countdown1 - hours) / 24;
                  if (hours < 10) {
                      var hours = "0" + hours;
                  }
                  document.write(hours + ":" + mins + ":" + secs);
                  document.getElementById(tzcd).innerHTML = hours + ':' + mins + ':' + secs;
                  setTimeout('displayTZCountDown(' + (countdown - 1) + ',\'' + tzcd + '\');', 999);
              }
        </script>
    </head>
    <body>
        <div id="sidebar-top">
            <div id="inner">
                <script>
                          start('9', '25', '12', '00', '00', 'myTimerID');
                </script>
            </div>
        </div>
    </body>
</html>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T12:39:03+00:00Added an answer on June 6, 2026 at 12:39 pm

    Looking at your script, it seems your HTML is missing an element with ID ‘myTimerID’

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a script that gets the content and images of blog posts
I am making a content script that does something with the google results webpage.
Not that I'm trying to prevent 'View Source' or anything silly like that, but
So, I'm making this context menus, which looks great in all major browsers, even
I'm making an app that as a UITableView that gets content from the web,
I am making a custom module where users can upload design content. I need
When I put value in textbox then its throught this error. I am making
I'm making a WYSIWYG editor, and I need to know how to get caret
I'm trying to use Java Opencl from within jruby, but am encountering a problem
I'm making a game that will allow content development and I'd like it to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.