Place this HTML where you want the timer to appear:
<span class="timerCountdown">3:00</span>
<span class="timerExpired">Expired</span>
CSS can hide the expired message by default:
<style>
.timerExpired {
display: none;
}
</style>
And finally the JS:
<script>
$(document).ready(function(){
var timer = 3 * 60;
var interval = setInterval(function(){
timer--;
var minute = parseInt(timer / 60);
var second = timer % 60;
second = ('0' + second).slice(-2);
$('.timerCountdown').text(minute + ':' + second);
if (timer == 0) {
$('.timerCountdown, .timerExpired').toggle();
}
}, 1000);
})
</script>