小编ale*_*lex的帖子

如何定期更新时间?

function timeClock()
{
    setTimeout("timeClock()", 1000);        
    now = new Date();
    alert(now);
    f_date = now.getDate()+" "+strMonth(now.getMonth())+" "+now.getFullYear()+" / "+timeFormat(now.getHours(), now.getMinutes());
    return f_date;
}

<span class="foo"><script type="text/javascript">document.write(timeClock());</script></span>
Run Code Online (Sandbox Code Playgroud)

警报(现在的); 每秒给我一个值,但它没有在html中更新.如何在不刷新页面的情况下更新html的时间?

javascript jquery datetime

15
推荐指数
2
解决办法
6万
查看次数

标签 统计

datetime ×1

javascript ×1

jquery ×1