欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

动态时钟

程序员文章站 2022-05-28 10:21:26
...
<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script  src="js/jquery.js"></script>
</head>
<body>
	<div id="s2">
		
	</div>
<script>
	$(function(){
		setInterval(
			function(){
	var date = new Date();var one = date.getSeconds();var two = date.getMinutes();var three = date.getHours();
				$("#s2").text(three+":"+two+":"+one);	
			}
			,
			1000);
		
		
			
			
	});
	
	
	
</script>
    
</body>
</html>


 

动态时钟