<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>显示当前时间</title>
<style>
.currenttime {
height: 200px;
width: 1000px;
color: purple;
margin: 0px auto;
text-align: center;
font-size: 35px;
background-image: url(./img/1.png);
display: flex;
justify-content: center;
align-items: center;
}
</style>
</head>
<body>
<div class="currenttime"></div>
<script>
function showTime() {
//获取currentTime
let currentTime = document.querySelector('.currenttime');
let time = new Date();
//年
简单定时器在页面显示当前时间(一看就懂)
最新推荐文章于 2023-12-26 08:57:25 发布