⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 17.htm

📁 介绍了javascript的常用的函数
💻 HTM
字号:
<html>
<head>
<title>在页面指定位置显示时钟</title>
<script language="javascript">
<!--
function showClock()
{
	d       = new Date();
	hours   = d.getHours();
	minutes = d.getMinutes();
	seconds = d.getSeconds();
	
	clck = (hours>=12)?"下午":"上午";
	
	hours = (hours>12)?hours-12:hours;
	hours = (hours<10)?"0"+hours:hours;
	
	minutes = (minutes<10)?"0"+minutes:minutes;
	seconds = (seconds<10)?"0"+seconds:seconds;
	
	time = clck + " " + hours + ":" + minutes + ":" + seconds;

	time = "<font size='5' face='Arial'><b>" + time + "</b></font>";
	myclock.innerHTML = time;
	setTimeout("showClock()",1000);
}
//-->
</script>
</head>
<body onLoad="showClock()">
<div id="myclock" style="position:absolute;left:10px;top:50px;"></div> 
</body>
</html>

⌨️ 快捷键说明

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