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 8739255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:53:53+00:00 2026-06-13T10:53:53+00:00

I am javascript impaired – I need to build a countdown script that counts

  • 0

I am javascript impaired – I need to build a countdown script that counts down 45 minutes and appends the remaining time into the title bar or the users browser, as well as when the time is up will operate a function like an alert message.

I wish I had code to start with.

  • 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-13T10:53:54+00:00Added an answer on June 13, 2026 at 10:53 am

    Here, this should work for you. (Demo)

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
        <script>
        var interval;
        var minutes = 1;
        var seconds = 5;
        window.onload = function() {
            countdown('countdown');
        }
    
        function countdown(element) {
            interval = setInterval(function() {
                var el = document.getElementById(element);
                if(seconds == 0) {
                    if(minutes == 0) {
                        el.innerHTML = "countdown's over!";  
                        alert("countdown's over!");
                        clearInterval(interval);
                        return;
                    } else {
                        minutes--;
                        seconds = 60;
                    }
                }
                if(minutes > 0) {
                    var minute_text = minutes + (minutes > 1 ? ' minutes' : ' minute');
                } else {
                    var minute_text = '';
                }
                var second_text = seconds > 1 ? 'seconds' : 'second';
                el.innerHTML = minute_text + ' ' + seconds + ' ' + second_text + ' remaining';
                document.title = minute_text + ' ' + seconds + ' ' + second_text + ' remaining';
                seconds--;
            }, 1000);
        }
        </script>
    </head>
    <body>
    <div id='countdown'></div>
    </body>
    </html>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Javascript I have code that will hide various sections in a MS CRM form
javascript with> var customer=document.getElementById('custList').value; and that works... Why does it work BUT... var customer=(form1.custList.value);
Javascript can manipulate the document the browser is displaying, so the following: <script> document.write(<table><tr><td>Hola</td><td>Adios</td></tr></table>);
Javascript closure definition says : A closure is an expression (typically a function) that
JavaScript converts my < into &gt; . I want to alert it but my
JavaScript's index is 32 bit, so it seems that the array index should be
I have installed a script on my website that allows for a low contrast
javascript snippet : <script type=text/javascript> $(document).ready(function() { setInterval(function() { $.getJSON('notif.php', function(data) { my_var =
JavaScript: var docHeadText = document.head.innerHTML; var patt =/\/*:.+?:*\//g; patt.compile(patt); docHeadText.match(patt); HTML: <head> <script type=text/javascript>
I need to be able to place the captcha image into a picturebox on

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.