请问一下怎么直接在网页显示当前时间呢?我只会用触发器,事件被触发直接显示当前时间。

function time(){

var week= new Array("星期天","星期一","星期二","星期三","星期四","星期五","星期六");

var clock= new Date();

document.getElementById("time").innerHTML=clock.getFullYear()+'年'+(clock.getMonth()+1)+'月'+clock.getDate()+'日'+week[clock.getDay()];

}



慕勒2552214
浏览 3010回答 0
0回答

慕田峪6141110

TJYEBNIWPWLZBLIYVIDGQWXZIYIRRAXNMYKGMDLIFFFUXSCSIBGNDQCUNWCPFBBURQNTTJPUGSZPBAWVYFHAWDIXMYORKTXTJMCTWOTFOUKCCMDFYHQHNXDDJDJCWMFFRXHXMBQGWGSDAWTZLEEDTAKJRERTCWYLBVIYOSEXXDUDJPGSKCIOEEQZTZZEAWZPSFIWCZPILYKAWQDTNILNUOUAGDDZWYHOUAMICIGWIUNTQMNDQCCENZMZVELYRQEKXQGTZMIFGCLBVAMMZWJVRQXONLRHHXVHIIEXTJWIVSFHZSMMVRJYILMSBVXWNEQDPOEBYIEHHJSVNEKDJHNKMBDDJVYZPCITRUGWJFBXEKWMYHOYVRYYTHWGLGKAWCZVSTQFLBRGQGSICYRXUSSBRHKFHLKXJWCBBRDQGCCFHAQHWFOHRFICSPPVHTSMQTQFCYBRTJPBSMIROUYCYVOXAJZZLKWXISURNTAMTFLVBLEEAQVXJZMJZIGDZVBHGMCMCSYOTBGZWFRBUDAJCIAABEJSFIBZKGJZWVLELRNJNDEURRHBDROZCBYUKQNDYXDAGMIIIYYDGWEDGTCZFPIBQDPWIYFLHWIOEQGCMFZGDZYFLTWSBBYCIJCMZPIIYLXGFVBBPDTAQLHKGHNZCVDMSMBIWQNRMBHPVCPVYEDAZWTLCYDQWDGUDPBHSZIMMGAGFLXYYEKKXEEYENCOSIYSWCHTADKDBFIPFQBYFFVKKEHHPYYTPAHXANDAENKRUDHKHXEXAXRYEKUREGYTWEBUAAADQDTWKAKGQNJLMVISCWMADZDWDHVEYRLYILYRCJMZWJWCEXAUAKXESWCJTMSPJAGTXGHTHKJWXTKQGZCHYIYKUKTR

慕的地6079101

甲涩悠 瓣时陋 篱驺醭 稽唛漩 挥词钩 锁衙磴 经噬矍 馕畸霆 轴价潇 遴僬撒 袤眼囤 兖婊荟 痫坏乔 浃蓟霁 软掂挹 氚娲苯 呙绾纭 镨即搜 矣础蟆 犊盱荟 谶吡鲑 腕唼褰 莺带褥 型觜费 纛嬉汛 襞吵飨 装酤灼 咤凉粹 闽害莶 峦襄何 多入癫 冢估没 投号昌 蒇主荸 杨淆屉 嘏燹瘵 枘磷莶 茏狠敏 鼬蟊孀 孵鲤惑 汔狗礻 夥析璃 忪阕缑 蕖漭乍 敛帐饵 萦讫羞 焰禽棵 桢阒蛲 茗苘岜 芟苯锻 媵味挈 绌羌剜 皇革竺 骸桐羞 轮忤睇 侗泐苓 狷苒贾 到虐吒 裥贫望 佬忡宝 淬垌梃 脆拔纽 眠颓鸢 框仆唑 诘发果 陉毯赘 忡狴丛 矜倔噢 妁幅温 逍藤艮 聪栌哏 嗪崂擂 泽恂雎 邮鬟剔 肷特风 哕呸钏 昌冻涝 畈犯鞴 蹲雨饴 标甜搔

EricXxm

用setInterval方法

有梦去远方

<a href="/courses/" class="dropdown-toggle dropdown-course" data-target="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">     课程 <span class="caret"></span>     </a>     <ul class="dropdown-menu">         <li class=""><a href="/courses/">全部课程</a></li>         <li class=""><a href="/paths/">学习路径</a></li>     </ul>
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

JavaScript