js-双色球
一、代码
1.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>
<style>
* {
margin: 0;
padding: 0;
}
li {
list-style: none;
width: 50px;
height: 50px;
border-radius: 50%;
text-align: center;
line-height: 50px;
color: #fff;
margin: 5px 5px;
border: 3px solid #fff;
}
li:hover {
cursor: pointer;
}
#redbox,
#bluebox,
#selectbox {
display: flex;
flex-direction: row;
flex-wrap: wrap;
}
.red {
background: red;
}
.blue {
background: blue;
}
.selected {
border: 3px solid black;
}
</style>
</head>
<body>
<div id="redbox">
</div>
<div id="bluebox">
</div>
<div id="selectbox"></div>
<div>
<input type="text" id="num">
<button id="btn">开始开奖</button>
</div>
<script src="./doublecolor.js"></script>
<script>
let dbc = new DoubleColorBoll();
let yi = er = san = si = wu = liu = 0;
//开始
document.getElementById("btn").onclick