代码拉取完成,页面将自动刷新
<!DOCTYPE html>
<html lang="en">
<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>
</head>
<style>
.unsetSomething {
border: dashed;
background: grey;
height: 300px;
width: 300px;
line-height: 300px;
font-size: 66px;
}
</style>
<body>
<center>
<h1 style="font-size: 50px">1711A班随机点名表</h1>
<div id="C_name" class="unsetSomething"></div>
<input type="button" id="name" value="开始点名" onclick="check_name()" style="width: 300px;height: 50px;" />
</center>
</body>
<script>
function check_class() {
var arr = Array("张金龙", "段秉君", "李梦雪", "朱增光", "王永豪", "程然", "王迪", "柳旭", "向博", "范俊丹", "檀清华", "王曼", "张志阳", "申柯", "朱恬恬", "张明凯", "杨骐鸣", "张业博", "许金豪", "王晓东", "尹彪彪", "郭振男", "屈娇秀", "吕艳琴", "刘学雷", "盖鑫鑫", "郭峰军", "李俊杰", "谢忠宁", "梁蓓研", "李佳豪", "张艳强", "黄友君", "刘瑞", "弓嗣荣", "鲁明文", "倪聪", "赵胜杰", "姜晓航", "徐朝阳", "刘世奇", "赵勃斌")
var key = parseInt(Math.random() * arr.length);
document.getElementById("C_name").innerHTML = arr[key];
}
function check_name() {
var name = document.getElementById("name").value;
if (name === "开始点名") {
document.getElementById("name").value = "停止点名";
// a = setlnterval(check_class(), 10);
a = setInterval('check_class()', 5);
} else {
document.getElementById("name").value = "开始点名";
clearInterval(a)
}
}
</script>
</html>
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。