Copy Coundown code snippet

Step 1:

				
					<span id="num1" class="num"></span>

<span id="num2" class="num"></span>

<span id="num3" class="num"></span>

<span id="num4" class="num"></span>

				
			

Step 2:

				
					<!--jQuery CDN link starts here-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js" integrity="sha512-aVKKRRi/Q/YV+4mjoKBsE4x3H+BkegoM/em46NNlCqNTmUYADjBbeNefNxYV7giUp0VxICtqdrbqU7iVaeZNXA==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<!--jQuery CDN link ends here-->


<script>
jQuery(function() {

// Set the date we're counting down to
var countDownDate = new Date("Jul 31, 2022 00:00:00").getTime();

  var countdown1 = document.getElementById("num1"); // get tag element
  var countdown2 = document.getElementById("num2"); // get tag element
  var countdown3 = document.getElementById("num3"); // get tag element
  var countdown4 = document.getElementById("num4"); // get tag element

// Update the count down every 1 second
var x = setInterval(function() {
 
  // Get today's date and time
  var now = new Date().getTime();
   
  // Find the distance between now and the countdown date
  var distance = countDownDate - now;
   
  // Time calculations for days, hours, minutes, and seconds
  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);
   
  //zero if number <10
  function pad(n){
    return (n < 10 ? "0" : "") + n;
}
 
  // format countdown string + set tag value
    countdown1.innerText = pad(days);
    countdown2.innerText = pad(hours);
    countdown3.innerText = pad(minutes);
    countdown4.innerText = pad(seconds);
 
  // If the count down is over, write some text 
  if (distance < 0) {
    clearInterval(x);
      countdown1.innerText = "O";
      countdown2.innerText = "V";
      countdown3.innerText = "E";
      countdown4.innerText = "R";
  }
}, 1000); 
});
</script>