本帖最后由 lucklys 于 2022-8-16 17:44 编辑
[HTML] 纯文本查看 复制代码 <!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
</head>
<body>
<div class="el-button">1111</div>
<div class="top_tip">2222</div>
<div class="el-button--danger">3333</div>
<div class="menu_controller">4444</div>
</body>
<script>
const list = ['el-button', 'top_tip', 'el-button--danger', 'menu_controller']
function sleep(number) {
var now = new Date()
var exitTime = now.getTime() + number
while (true) {
now = new Date()
if (now.getTime() > exitTime) return
}
}
function run() {
for (var i = 0; i < list.length; i++) {
document.getElementsByClassName(list[i])[0].onclick()
sleep(2000)
}
}
setInterval(() => {
run()
}, list.length+1 * 2000)
run()
</script>
</html>
|