动态时钟
程序员文章站
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>