当前位置:网站首页>Realize a JS lottery?
Realize a JS lottery?
2022-07-24 13:19:00 【Mark community】
<!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>demo</title>
</head>
<body>
<button> Start </button>
<button> stop it </button>
<p></p>
</body>
<script>
var btn=document.querySelectorAll("button")[0];
var btn1 = document.querySelectorAll("button")[1];
var p=document.querySelector("p");
var timer=null;
var arrs = [" The first prize ", " The second prize ", " The third prize ", " thank you ", " The grand prize "];
btn.onclick=()=>{ timer = setInterval(() => {
clearInterval(timer);
var arr = arrs[Math.floor(Math.random() * arrs.length)]; p.innerHTML = arr; }, 10); }
btn1.onclick=()=>{ clearInterval(timer) }
</script>
</html>
12345678910111213141516171819202122232425More on :https://blog.csdn.net/weixin_44519496/article/details/120127169
边栏推荐
- 【论文阅读】TEMPORAL ENSEMBLING FOR SEMI-SUPERVISED LEARNING
- Experience on how to improve the anti-interference of TTL (UART) communication
- Chat room project
- SSM在线租房售房平台多城市版本
- Notes on Linear Algebra -- lesson 25 -- projection of vectors on axes
- Generator and async solve asynchronous programming
- 登临科技联合创始人王平:创新+自研“双核”驱动,GPU+赋能AI落地生根|量子位·视点分享回顾...
- LEADTOOLS 22 套件 LEADTOOLS 超级套
- Implementation of dynamic columns in EAS BOS doc list
- Arduino框架下ESP32 EEPROM库函数实现对各数据类型保存示例
猜你喜欢

Inversion of array (output in reverse order) (define an array and assign a value to output the array in reverse order)

SSM hospital inpatient management system

Summary of embedded network problems (packet loss of network card, unrecognized network card)

户外广告牌不能“想挂就挂”!广州城管部门加强户外广告安全管理

LEADTOOLS 22 套件 LEADTOOLS 超级套

【论文阅读】Mean teachers are better role models
![[datasheet] interpretation of phy lan8720 network chip](/img/77/b99c926db2c99df32cecb188c1f1e1.png)
[datasheet] interpretation of phy lan8720 network chip

Pointer advanced part (1)

Finclip's "applet export app" function has been updated again by the company

I realize large top stack with C I
随机推荐
Deep and shallow copies of objects, extends
31. Climb stairs
35.8. string conversion integer (ATOI)
About the concept of thread (1)
【论文阅读】TEMPORAL ENSEMBLING FOR SEMI-SUPERVISED LEARNING
FinClip 「小程序导出 App 」功能又双叒叕更新了
ESP32ADC
Voice recognition based on MATLAB
Windivert:可抓包,修改包
Basic operation of file
Usage of swipemenurecyclerview
hdparm
SSM online examination system including documents
Modern data architecture selection: Data fabric, data mesh
Research on data governance quality assurance
SSM online campus album management platform
Proxy
23. Spiral matrix
[datasheet] interpretation of cs5480 data book of metering chip
30. Rearrange the linked list