<!DOCTYPE html>
<html lang='zh-CN'>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
div {
color: teal;
font-size: 30px
}
</style>
</head>
<body>
<div>
点击获取
</div>
<button>按钮</button>
<script>
const btn = document.querySelector('button')
const div = document.querySelector('div')
time = 3
let timer
// 1.setInterval方法
// const fn = () => {
// if(time > 0) {
// time--
// div.innerHTML = '倒计时' + time
js验证码倒计时
最新推荐文章于 2024-05-13 08:00:00 发布