<!DOCTYPE html>
<html>
<head>
<script type="text/javascript">
function startClock()
{
setInterval(getTime, 1000);
}
function getTime()
{
var now = new Date();
document.getElementById('clock').value = now.getFullYear()
+ "-" + (now.getMonth() + 1)
+ "-" + now.getDate()
+ " " + now.getHours()
+ ":" + now.getMinutes()
+ ":" + now.getSeconds();
}
</script>
</head>
<body οnlοad="startClock()">
<input id="clock" />
</body>
</html>
文本框显示时间
最新推荐文章于 2023-04-27 10:07:32 发布