<html>
<head>
<title>时间显示</title>
</head>
<body onload="time()">
<div id=meizz>
<script language=javascript><!--
function time()
{
var now = new Date();
var h = (now.getHours() > 9) ? now.getHours() : "0" + now.getHours();
var m = (now.getMinutes() > 9) ? now.getMinutes() : "0" + now.getMinutes();
var s = (now.getSeconds() > 9) ? now.getSeconds() : "0" + now.getSeconds();
var noon= (now.getHours() > 12)? "PM" :"AM";
var myclock="<center><font color=red>现在是:"+h+":"+m+":"+s+":"+" "+noon+"</font></center>";
document.all.meizz.innerHTML = myclock;
setTimeout("time()",1000) ;
}
-->
</script>
</body>
</html>
<head>
<title>时间显示</title>
</head>
<body onload="time()">
<div id=meizz>
<script language=javascript><!--
function time()
{
var now = new Date();
var h = (now.getHours() > 9) ? now.getHours() : "0" + now.getHours();
var m = (now.getMinutes() > 9) ? now.getMinutes() : "0" + now.getMinutes();
var s = (now.getSeconds() > 9) ? now.getSeconds() : "0" + now.getSeconds();
var noon= (now.getHours() > 12)? "PM" :"AM";
var myclock="<center><font color=red>现在是:"+h+":"+m+":"+s+":"+" "+noon+"</font></center>";
document.all.meizz.innerHTML = myclock;
setTimeout("time()",1000) ;
}
-->
</script>
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货