首页 > 解决方案 > 如何在倒计时中更改 txtcolor

问题描述

我正在使用此倒计时重定向到另一个页面。

<script type="text/javascript">

var timeleft = 5;
var downloadTimer = setInterval(function(){
timeleft--;
document.getElementById("countdowntimer").textContent = ((timeleft >= 10) ? timeleft : ("0" + timeleft));
if(timeleft <= 0){
    clearInterval(downloadTimer);
    window.location.replace("url.html");
    }
},1000);

</script>

在 html 中,我使用它来激活:

<span id="countdowntimer"><font color="#C0C0C0">&nbsp;</font></span>

如何更改倒计时 txt 的颜色甚至使其不可见?

请帮助一个java假人。

标签: javacountdown

解决方案


推荐阅读