js-01.html
var today=new Date();
var year=today.getYear();
var month=today.getMonth();
var hour=today.getHours();
var minute=today.getMinutes();
function showTime(){
document.getElementById("content").innerHTML="
现在为您报时:
";document.getElementById("content").innerHTML+="
北京时间"+year+"年"+month+"月"+date+"日
";document.getElementById("content").innerHTML+="
"+hour+"时"+minute+"分
";}
function clearContent(){
document.getElementById("content").innerHTML="";
}