<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
body {
font-family: "Microsoft YaHei", serif;
}
body, dl, dd, p, h1, h2, h3, h4, h5, h6 {
margin: 0;
}
ol, ul, li {
margin: 0;
padding: 0;
list-style: none;
}
img {
border: none
}
#wrap{
margin: 50px auto;
width: 500px;
height: 400px;
border: 1px solid gray;
}
.top{
position: relative;
width: 100%;
height: 100px;
}
#wrap .top input{
position: absolute;
top: 5px;
right: 5px;
}
#wrap .bottom{
overflow: hidden;
position: relative;
width: 100%;
height: 300px;
}
#wrap .bottom div{
position: absolute;
bottom: 0;
}
</style>
</head>
<body>
<div id="wrap">
<div class="top">
<p>抽奖:2元一次</p>
<p>一等奖:10元</p>
<p>二等奖:5元</p>
<p>三等奖:2元</p>
<input type="button" value="抽奖一次" id="btn">
</div>
<div class="bottom">
<div id="show">
</divid>
</div>
</div>
<script>
(function () {
let oBtn = document.getElementById("btn");
let oShow = document.getElementById("show");
oBtn.onclick = function () {
let random = Math.random()*100;
let txt;
if (random<2) {
txt = "恭喜您:一等奖"
}else if (random<12) {
txt = "恭喜您:二等奖"
}else if (random<50) {
txt = "恭喜您:三等奖"
}else {
txt = "很遗憾,谢谢惠顾"
}
oShow.innerHTML += `<p>${txt}</p>`
}
})();
</script>
</body>
</html>
Python3Turtle