This script will count down from 30 then redirect to https://www.google.com once it hits 0.
<script type="text/javascript">
function countdown () {
var i = document.getElementById('counter');
if (parseInt(i.innerHTML)<=0) {
window.location = 'https://www.google.com';
}
if (parseInt(i.innerHTML)!=0) {
i.innerHTML = parseInt(i.innerHTML)-1;
}
}
setInterval(function(){ countdown(); },1000);
</script>
Change the ‘30’ to your desired countdown time.
<span id="counter">30</span>