博客
关于我
显示当前时间--小小迷你计时器
阅读量:491 次
发布时间:2019-03-06

本文共 1241 字,大约阅读时间需要 4 分钟。

<html>

<head>

 

<title>计时器</title>

<script language="javascript">alert("ok");

function disptime(){

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.myclock.value=hour+":"+minute+":"+second+""+apm;

var myTime=setTimeout("disptime()",1000);

</script>

<STYLE type="text/css">

input { font-size: 100px; color: #CC0000; border-style:none }

</style>

<body onLoad="disptime()">

<center><form name="myform">

<input  name="myclock" type="text" value="" />

</form>

</center>

</body>

</html>

转载地址:http://nvndz.baihongyu.com/

你可能感兴趣的文章
mysql导入数据库出现:Incorrect string value: '\xE7\x82\xB9\xE9\x92\x9F' for column 'chinese' at row 1...
查看>>
mysql导入(ibd文件)
查看>>
Mysql工作笔记006---Mysql服务器磁盘爆满了_java.sql.SQLException: Error writing file ‘tmp/MYfXO41p‘
查看>>
MySQL工具1:mysqladmin
查看>>
mysql常用命令
查看>>
MySQL常用命令
查看>>
mysql常用命令
查看>>
MySQL常用指令集
查看>>
mysql常用操作
查看>>
MySQL常用日期格式转换函数、字符串函数、聚合函数详
查看>>
MySQL常见架构的应用
查看>>
MySQL常见的三种存储引擎(InnoDB、MyISAM、MEMORY)
查看>>
MySQL常见约束条件
查看>>
MySQL常见错误
查看>>
MySQL常见错误分析与解决方法总结
查看>>
mysql并发死锁案例
查看>>
MySQL底层概述—1.InnoDB内存结构
查看>>
MySQL底层概述—2.InnoDB磁盘结构
查看>>
MySQL底层概述—3.InnoDB线程模型
查看>>
MySQL底层概述—4.InnoDB数据文件
查看>>