I am trying to make an hta with a countdown timer. I have a timer that works fine in html but when i put the code in to an hta it gives an error. I have also tried running the html version inside of an iframe n an hta. Any help is appreciated.
function startTimer(duration, display) {
var timer = duration, minutes, seconds;
setInterval(function () {
minutes = parseInt(timer / 60, 10)
seconds = parseInt(timer % 60, 10);
minutes = minutes < 10 ? "0" + minutes : minutes;
seconds = seconds < 10 ? "0" + seconds : seconds;
display.textContent = minutes + ":" + seconds;
if (--timer < 0) {
timer = duration;
}
}, 1000);
}
window.onload = function () {
var fiveMinutes = 60 * 60,
display = document.querySelector('#time');
startTimer(fiveMinutes, display);
};
</script>
<body>
<font color="red" size="7">
<big>
<div> <span id="time">60:00</span></div>
</big>
</font>
</body>
<body background="image1.jpg">