//HTMEL
<body>
<div class="content"> </div>
</body>
//css
.bottom,over {
text-align: center;
line-height: 0px;
}
.bottom div {
display: inline-block;
width: 30px;
height: 30px;
border: 1px solid #808080;
background-color: #f4a;
text-align: center;
font: 20px/30px arial;
}
//JS
// 保存 初始雷化记录 和 拆雷记录 100个按钮中 有25个雷
var box = Array(10);
//初始化底层
function initBottom() {
const content = document.getElementsByClassName('content')[0];
const bottom = document.createElement('div');
content.appendChild(bottom);
bottom.className = "bottom";
for (let i = 0; i < 10; i++) {
box[i] = new Array(10);
for (let j = 0; j < 10; j++) {
const div = document.createElement('div');
bottom.appendChild(div);
div.id = "bottom[" + i + "][" + j + "]";
box[i][j] = 0;
}
bottom.innerHTML = bottom.innerHTML + "<br />";
}
initB