附源代码;
<!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>
<style>
.box {
width: 200px;
height: 200px;
line-height: 200px;
background-color: #ccc;
font-size: 30px;
text-align: center;
}
</style>
</head>
<body>
<div class="box">此乃点名器</div>
<input type="button" value="点名" id="btn">
<!-- <button id="btn">点名</button> -->
<script>
var btn = document.getElementById("btn");
var box = document.getElementsByClassName("box"