We are Using Third Party Ads. Please bear with us Support us. Any issues can be solve Via Email. Click here ➡️ Contact Us!

Countdown timer script For blogger

 

Creating a countdown timer script 

for a Blogger (Blogspot) website involves using HTML, JavaScript, and some CSS. Here's a basic example of how you can add a countdown timer to your Blogger blog:

Log in to your Blogger account

 and navigate to the blog where you want to add the countdown timer.

Create a new blog post 

or edit an existing one where you want to display the countdown timer.

Switch to HTML 

mode in the Blogger post editor.

Add the following HTML

and JavaScript code to your blog post where you want the countdown timer to appear:


<!DOCTYPE html>
<html>
<head>
  <title>Countdown Timer</title>
</head>
<body>
  <div id="countdown">
    <div id="timer">
      <span id="days"></span>
      <span id="hours"></span>
      <span id="minutes"></span>
      <span id="seconds"></span>
    </div>
  </div>

  <script>
    // Set the date and time for the countdown
    var countDownDate = new Date("September 30, 2023 00:00:00").getTime();

    // Update the countdown every second
    var x = setInterval(function() {
      var now = new Date().getTime();
      var distance = countDownDate - now;

      var days = Math.floor(distance / (1000 * 60 * 60 * 24));
      var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
      var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
      var seconds = Math.floor((distance % (1000 * 60)) / 1000);

      document.getElementById("days").innerHTML = days + "d ";
      document.getElementById("hours").innerHTML = hours + "h ";
      document.getElementById("minutes").innerHTML = minutes + "m ";
      document.getElementById("seconds").innerHTML = seconds + "s ";

      if (distance < 0) {
        clearInterval(x);
        document.getElementById("countdown").innerHTML = "EXPIRED";
      }
    }, 1000);
  </script>
</body>
</html>

Customize the countdown

date and time by changing the countDownDate variable to your desired date and time in the format "Month Day, Year HH:MM:SS".

Switch back to Compose

mode in the Blogger post editor if needed.

Preview or Publish

your blog post to see the countdown timer in action.


This code creates a simple countdown timer that counts down to the specified date and time. You can further customize the appearance of the timer by modifying the CSS styles and layout as needed.




                  Happy Blogging

2 kommentaari

  1. 🥰
  2. This script is
    Best
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.