当前位置:网站首页>Can you make a JS to get the verification code?
Can you make a JS to get the verification code?
2022-07-26 05:47: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> Verification Code </title>
<style>
.get{
cursor: pointer;
}
.reset{
display: none;
}
.reset span{
color:red;
}
</style>
</head>
<body>
<input type="text"><button> determine </button>
<p class="get"> Get verification code </p>
<p class="reset"> Reacquire the captcha <span>10</span>s</p>
</body>
<script>function $(el) {
return document.querySelector(el);
}
let val="";
let timer=null;
function stop() {
clearInterval(timer);
timer=null;
}
$(".get").onclick=function(){
this.style.display="none";
$(".reset").style.display="block";
var chars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K',
'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'];
function generateMixed(n) {
var res = "";
for(var i = 0; i < n; i++) {
var id=Math.ceil(Math.random() * 35);
res +=chars[id];
}
return res;
}
var num1=generateMixed(4);
val=num1;
alert(num1);
var i=10;
timer=setInterval(() => {
i--;
$(".reset span").innerText=i;
if(i===0){
stop();
$(".reset").style.display="none";
$(".get").style.display="block";
}
}, 1000);For more information, please refer to the original , Reproduced from :https://blog.csdn.net/weixin_44519496/article/details/120074372
边栏推荐
- Attack and defense world -- easy_ web
- Select sort / insert sort / bubble sort
- 二叉树的性质 ~
- Unity Profiler
- Using easyexcel to import tables to realize batch insertion of xlsx files ----- MySQL of Linux
- I also found excellent software and hardware projects, all open source
- No EGL Display 报错解决
- 我又发现了超赞的软硬件项目,全部开源
- Lemon class automatic learning after all
- No EGL display error resolution
猜你喜欢
随机推荐
Benji Bananas 开启第二季边玩边赚奖励活动,支持使用多张 Benji 通行证!
Using easyexcel to import tables to realize batch insertion of xlsx files ----- MySQL of Linux
The refurbishment and counterfeiting of chips have made people feel numb
Properties of binary tree~
C language explanation series -- understanding of functions (3) formal parameters, arguments, nested calls and chain access
轻量级单片机命令行交互项目,全部开源
软件测试面试题全网独家没有之一的资深测试工程师面试题集锦
柠檬班自动化学习毕竟
IVR在voip电话系统的应用与价值
How to name the project version number? Looks like cow b
QT writing IOT management platform 47 general database settings
Knowledge points of Polymer Physics
ES Cluster in Red status: what about write & delete operations?
调试利器!一款轻量级日志库 log.c
秋招-准备计划
87. Disturb string
某公司给每个工位装监控:只为看员工写代码?
517. Super washing machine
Redis事务
一招教你轻松看懂波特图









![[personal summary] end of July 24, 2022](/img/9e/dfc37c2684aa8849291817782c947b.png)