61,110
社区成员
发帖
与我相关
我的任务
分享
<script>
var t, i;
i = 0;
function startRefresh()
{
t = setInterval("refresh()", 1000);
}
function stopRefresh()
{
clearInterval(t);
}
function refresh()
{
document.getElementById("d").innerHTML = "<font color='red'>" + i.toString(10) + "</font>";
i++;
}
</script>
<input type="button" onclick="startRefresh()" value="开始">
<input type="button" onclick="stopRefresh()" value="停止">
<div id="d"></div>