一、效果
二、HTML代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>秒杀倒计时</title>
</head>
<body>
<!-- 预设框架结构 -->
<!-- <section>
<div></div>
<div></div>
<div>
<span>20</span>
<span>:00场 场倒计时</span>
</div>
<div>
<span>01</span>
<span>:</span>
<span>33</span>
<span>:</span>
<span>50</span>
</div>
</section> -->
<script src="./index.js"></script>
</body>
</html>
三、JS代码块
let secEle = document.createElement("section");
secEle.style.width = "300px";
secEle.style.height = "400px";
secEle.style.backgroundColor = "red";
let bodyEle = document.getElementsByTagName("body"