1.html

来自「用JAVASCRIPT设计各种特效」· HTML 代码 · 共 29 行

HTML
29
字号
<html>
<head>
<script language="javascript">
 function distime(){
  var time=new Date();
  var hour=time.getHours();
  var minute=time.getMinutes();
   var second=time.getSeconds();
var apm="AM";
if(hour>12)
{
 hour=hour-12;
 apm="PM";
}
if(minute<10)
 minute="0"+minute;
if(second<10)
 second="0"+second;
 document.myform.mc.value=hour+":"+minute+":"+second+apm;
 var myTime=setTimeout("distime()",1000);
}
</script>
</head>
<body onLoad="distime()">
<form id="myform" name="myform" >
<input type="text" id="mc" name="mc">
</form>
</body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?