2 Star 0 Fork 0

了云/1711AReact

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
1711A随机点名表.html 1.82 KB
一键复制 编辑 原始数据 按行查看 历史
了云 提交于 2018-07-02 19:02 . 第三次提交
<!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>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/duanbingjun/1711AReact.git
git@gitee.com:duanbingjun/1711AReact.git
duanbingjun
1711AReact
1711AReact
master

搜索帮助